From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D5DC53851C07; Thu, 19 May 2022 07:28:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D5DC53851C07 From: "linkw at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug debug/105627] -fcompare-debug failure at -Og for powerpc64le-unknown-linux-gnu Date: Thu, 19 May 2022 07:28:56 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: debug X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: compare-debug-failure X-Bugzilla-Severity: normal X-Bugzilla-Who: linkw at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: linkw at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status assigned_to 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: Thu, 19 May 2022 07:28:56 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105627 Kewen Lin changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |linkw at gcc dot gn= u.org --- Comment #2 from Kewen Lin --- Thanks for reporting and triaging. Although loops in function rs6000_analyze_swaps only handles NONDEBUG_INSN_P insns, when doing unionfind_union it's still possible to union with debug i= nsn, as some def reg of nondebug insn can be used in debug insn, it makes the un= ions become different unexpectedly.=20 The below patch can fix the issue, I don't think we need the similar handli= ng in union_defs as I feel it's impossible to have the case that one reg which= is defined by debug insn but used in nondebug insn. diff --git a/gcc/config/rs6000/rs6000-p8swap.cc b/gcc/config/rs6000/rs6000-p8swap.cc index d301bc3fe59..3aa90034c29 100644 --- a/gcc/config/rs6000/rs6000-p8swap.cc +++ b/gcc/config/rs6000/rs6000-p8swap.cc @@ -242,8 +242,9 @@ union_uses (swap_web_entry *insn_entry, rtx insn, df_ref def) if (DF_REF_INSN_INFO (link->ref)) { rtx use_insn =3D DF_REF_INSN (link->ref); - (void)unionfind_union (insn_entry + INSN_UID (insn), - insn_entry + INSN_UID (use_insn)); + if (NONDEBUG_INSN_P (use_insn)) + (void) unionfind_union (insn_entry + INSN_UID (insn), + insn_entry + INSN_UID (use_insn)); }=