https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128687

--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Andrew Macleod <[email protected]>:

https://gcc.gnu.org/g:b85f2169fb3b0a25b5e53974775df3086d900376

commit r17-6427-gb85f2169fb3b0a25b5e53974775df3086d900376
Author: Andrew MacLeod <[email protected]>
Date:   Tue Nov 17 12:16:01 2026 -0500

    range_of_phi should process all arguments.

    Range_of_phi was accumulating the range of any equivalences seperately
    fromt he main range, and then combining them with the main range
    if there were nothing but a single equivlaence at the end.

    This wasn't actually saving anything. we still perform a union on each
    argument with a range, and as the PR show, we lose the +/- 0.0
    range on occasion.   There is also a window for wrongness if not all
    arguments are the same equivalence, and the equivalent argument does
    not have a range yet.   I don't thinkthis would ever trigger, and I also
    do not think thre is any benefit to the current approach as any
    equivalence never gets used in any other way.

    Its easier to simply process each argument and union in the range.  It
    also turns out to be .025% faster as well.

            PR tree-optimization/128687
            gcc/
            * gimple-range-fold.cc (fold_using_range::range_of_phi): Accumulate
            the range of every argument unconditionally.

            gcc/testsuite/
            * gcc.dg/torture/pr128687.c: New.

Reply via email to