From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id EF1123857736; Mon, 18 Sep 2023 20:45:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EF1123857736 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1695069956; bh=I8G77YXnheH53tM2KCW370XQXV5GELR+exU/liNFpEI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=WVG1GXs48+P4xAi/UPo3KOQ+7eK9ys6T1TV/O7aGOh+3HtXCwg8DF4cQ1dwg3zA6H 8NRhw/JcPrz07T+9+9YlG80Te3eo3UtTusWfgzT0K0YlYallDMZfDQ0/HLIqFZTalT wnRYmm6dubCx+zZPdG/moV42OfzQo7S5Tw0R4yzA= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/111435] [14 Regression] gimple_zero_one_valued_p() infinite recursion Date: Mon, 18 Sep 2023 20:45:56 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: build, ice-on-valid-code, patch X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: pinskia at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D111435 --- Comment #13 from CVS Commits --- The trunk branch has been updated by Andrew Pinski : https://gcc.gnu.org/g:951d3c191d01440ad54415f683437770b0c957e4 commit r14-4113-g951d3c191d01440ad54415f683437770b0c957e4 Author: Andrew Pinski 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.=