From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4B4CF3857C43; Mon, 22 Nov 2021 10:20:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4B4CF3857C43 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/103351] [12 Regression] '-fcompare-debug' failure (length) at -O2 since r12-5301-g045206450386bcd7 Date: Mon, 22 Nov 2021 10:20:42 +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: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth 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, 22 Nov 2021 10:20:42 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103351 --- Comment #5 from Richard Biener --- So the issue is that iterative_hash_expr of &__str._M_local_buf is not the same for -g vs. -g0 which results in different ordering of the vector of PHI arguments in sorted form. First there's missing ordering we can use based on ->dest_idx which should stabilize the sort somewhat. But then it might still be that we end up with different basic-block numbers when there are two clusters of same PHI args and thus two forwarders to be generated. In the end this is because we hash in DECL_UID which are not the same here (2872 vs 2873) which is OK. So for the latter issue not exposed in this testcase we should order clusters after the first ->dest_idx for example. Though I'm not sure it is an isssue (but it could also improve stability of testcases when reducing). I'll try to fixup piecewise.=