https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120951
--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> --- use_internal_fn has: ``` /* Skip the call if LHS == LHS. If we reach here, EDOM is the only valid errno value and it is used iff the result is NaN. */ conds.quick_push (gimple_build_cond (EQ_EXPR, lhs, lhs, NULL_TREE, NULL_TREE)); ``` Which is only a problem as `a == a` with signaling nans can trap and with non call exceptions can cause an exception. The easiest and correct way to fix this is s/EQ_EXPR/ORDERED_EXPR/ which is the same when not having signaling NaNs but with signaling NaNs ORDERED_EXPR is non-trapping so it will work here and such.