https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108279
--- Comment #21 from Wilco <wilco at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #20)
> __attribute__((noinline, optimize ("rounding-math"))) static int
> round_to_nearest (void) { return 1.0f - __FLT_MIN__ == 1.0f + __FLT_MIN__; }
Wouldn't that always set inexact?
> 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.
Yes that wouldn't work in fenv but FP emulation functions don't need to read
the exception flags.