[Bug tree-optimization/126637] [17 Regression] wrong code at -O{s,2,3} with -fwhole-program on x86_64-linux-gnu

"aldyh at gcc dot gnu.org via Gcc-bugs" <[email protected]> Thu, 06 Aug 2026 06:51:33 +0000
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126637

Aldy Hernandez <aldyh at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |aldyh at gcc dot gnu.org

--- Comment #3 from Aldy Hernandez <aldyh at gcc dot gnu.org> ---
It looks like both operator_equal::fold_range and
operator_not_equal::fold_range are special casing signed zeros, and are using
the hull, instead of the inner bounds.

else if (real_iszero (&op1.lower_bound ())
           && real_iszero (&op1.upper_bound ())
           && real_iszero (&op2.lower_bound ())
           && real_iszero (&op2.upper_bound ())
           && !maybe_isnan (op1, op2))
    // [-0.0, 0.0] == [-0.0, 0.0] or similar.
    r = range_true (type);