From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id EBF2F385841B; Mon, 25 Oct 2021 08:45:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EBF2F385841B From: "marxin at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/102902] [12 Regression] -O3 produces code that uses an uninitialized variable but originally was not used by r12-3876 Date: Mon, 25 Oct 2021 08:45:18 +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: 12.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: marxin at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Oct 2021 08:45:19 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102902 --- Comment #3 from Martin Li=C5=A1ka --- I guess fixed with: commit aa15952d646fd5dd569fce287b719a737ae66e4f (HEAD -> master, origin/tru= nk, origin/master, origin/HEAD) Author: Richard Biener Date: Mon Oct 25 09:33:15 2021 +0200 tree-optimization/102920 - fix PHI VN with undefined args This fixes a latent issue exposed by now allowing VN_TOP in PHI arguments. We may only use optimistic equality when merging values on different edges, not when merging values on the same edge - in particul= ar we may not choose the undef value on any edge when there's a not undef value as well. 2021-10-25 Richard Biener PR tree-optimization/102920 * tree-ssa-sccvn.h (expressions_equal_p): Add argument controlling VN_TOP matching behavior. * tree-ssa-sccvn.c (expressions_equal_p): Likewise. (vn_phi_eq): Do not optimistically match VN_TOP. * gcc.dg/torture/pr102920.c: New testcase.=