https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93806
--- Comment #26 from joseph at codesourcery dot com <joseph at codesourcery dot com> --- I wouldn't be surprised if such a test could be constructed in the absence of -funsafe-math-optimizations, that does a single conversion of an out-of-range integer to a floating-point type in the abstract machine but where that conversion gets duplicated so that one copy is done at compile time (valid with -fno-trapping-math, covered by other bugs in the -ftrapping-math case where it loses exceptions) and the other copy is done at run time and the particular instruction used doesn't follow the logic in fold_convert_const_int_from_real of converting NaN to zero and saturating other values. Under Annex F, such an out-of-range conversion is defined to raise "invalid" and return an unspecified value (that is, an unspecified value represented in the given integer type, with any given execution of the conversion in the abstract machine returning a single, stable value, but different executions possibly returning different values).