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

--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Andrea Pinski <[email protected]>:

https://gcc.gnu.org/g:08cc07aedf61cf69d6de3661728345572d7217d3

commit r17-5097-g08cc07aedf61cf69d6de3661728345572d7217d3
Author: Andrea Pinski <[email protected]>
Date:   Sat Sep 26 09:05:35 2026 -0700

    range-ops: Allow for non singleton for deriving from comparisons [PR127485]

    So currently we only allow deriving other operands from comparisons on the
edges
    using singleton.  That is `a == CST` and only on the true edge there.  This
means
    in some cases like when we know that `a != 0`, we don't derive information
    from `a = b - c` where we notice that `b != c` on that edge too.

    I have not measued the compile time or how efficient this is though.
    But since most of the time was already added with the
r17-4663-gbddea69ee406a
    change in register_outgoing_edges; this instead of bypassing for the
singleton
    case.

    Bootstrapped and tested on x86_64-linux-gnu.

            PR tree-optimization/127485

    gcc/ChangeLog:

            * gimple-range-fold.cc (fur_source::register_outgoing_edges): Don't
            require a singleton; only not undefined or varying.

    gcc/testsuite/ChangeLog:

            * gcc.dg/tree-ssa/vrp-cmp-sub-1.c: New test.
            * gcc.dg/tree-ssa/vrp-cmp-sub-2.c: New test.
            * gcc.dg/tree-ssa/vrp-cmp-sub-3.c: New test.

    Signed-off-by: Andrea Pinski <[email protected]>

Reply via email to