From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 75A223858C60; Fri, 21 Jan 2022 21:03:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 75A223858C60 From: "rdapp at linux dot ibm.com" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/104153] [12 Regression] ICE due to recent ifcvt changes Date: Fri, 21 Jan 2022 21:03:50 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rdapp at linux dot ibm.com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 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: Fri, 21 Jan 2022 21:03:50 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104153 --- Comment #3 from rdapp at linux dot ibm.com --- Both of your guesses are correct :) or1k_expand_compare () indeed modifies= the condition/comparison in-place. As I use cc_cmp directly from the condition= of the jump it is changed but never reverted. The following helps for me: diff --git a/gcc/ifcvt.cc b/gcc/ifcvt.cc index fe250d508e1..20debc0822a 100644 --- a/gcc/ifcvt.cc +++ b/gcc/ifcvt.cc @@ -3390,7 +3390,7 @@ noce_convert_multiple_sets_1 (struct noce_if_info *if_info, /* Decompose the condition attached to the jump. */ rtx cond =3D noce_get_condition (jump, &cond_earliest, false); - rtx cc_cmp =3D cond_exec_get_condition (jump); + rtx cc_cmp =3D copy_rtx (cond_exec_get_condition (jump)); rtx rev_cc_cmp =3D cond_exec_get_condition (jump, /* get_reversed */ tru= e); rtx_insn *insn;=