https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107608
--- Comment #41 from Richard Biener <rguenth at gcc dot gnu.org> --- We could fix the testcase with diff --git a/gcc/testsuite/gcc.dg/pr95115.c b/gcc/testsuite/gcc.dg/pr95115.c index 69c4f83250c..09273e445d2 100644 --- a/gcc/testsuite/gcc.dg/pr95115.c +++ b/gcc/testsuite/gcc.dg/pr95115.c @@ -17,6 +17,7 @@ int main (void) { double r = x (); + volatile double rr = r; if (!__builtin_isnan (r)) abort (); if (!fetestexcept (FE_INVALID)) that preserves optimizing the isnan check but also preserves the computation and checks the non-propagation of a NaN.