use gcc detection for mri / ree, fix #1596