https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107608
--- Comment #14 from Richard Biener <rguenth at gcc dot gnu.org> --- const_binop has /* Don't constant fold this floating point operation if the result has overflowed and flag_trapping_math. */ if (flag_trapping_math && MODE_HAS_INFINITIES (mode) && REAL_VALUE_ISINF (result) && !REAL_VALUE_ISINF (d1) && !REAL_VALUE_ISINF (d2)) return NULL_TREE;