https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108279
--- Comment #20 from Jakub Jelinek <jakub at gcc dot gnu.org> --- __attribute__((noinline, optimize ("rounding-math"))) static int round_to_nearest (void) { return 1.0f - __FLT_MIN__ == 1.0f + __FLT_MIN__; } and if (round_to_nearest ()) \ _fcw = FP_RND_NEAREST; \ else \ __asm__ __volatile__ ("%vstmxcsr\t%0" : "=m" (_fcw)); \ Except that from _fcw we don't determine just the rounding mode but also what exceptions are enabled.