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

--- Comment #13 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Andrew Pinski <pins...@gcc.gnu.org>:

https://gcc.gnu.org/g:951d3c191d01440ad54415f683437770b0c957e4

commit r14-4113-g951d3c191d01440ad54415f683437770b0c957e4
Author: Andrew Pinski <apin...@marvell.com>
Date:   Sat Sep 16 15:19:58 2023 -0700

    MATCH: Avoid recursive zero_one_valued_p for conversions

    So when VN finds a name which has a nop conversion, it says
    both names are equivalent to each other and the valuaization
    function for one will return the other. This normally does not
    cause any issues as there is no recursive matches. But after
    r14-4038-gb975c0dc3be285, there was one added. So we would
    do an infinite recursion on the match and never finish.
    This fixes the issue (and adds a comment in match.pd) by
    for converts just handle one level instead of being recursive
    always.

    OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions.

    Note the testcase was reduced from tree-ssa-loop-niter.cc and then
    changed slightly into C rather than C++ but it still needs exceptions
    turned on get the IR that VN would produce this equivalence relationship
    going on. Also had to turn off early inline to force put to be inlined
later.

            PR tree-optimization/111435

    gcc/ChangeLog:

            * match.pd (zero_one_valued_p): Don't do recursion
            on converts.

    gcc/testsuite/ChangeLog:

            * gcc.c-torture/compile/pr111435-1.c: New test.

Reply via email to