From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 404A5384A034; Mon, 27 Apr 2020 18:33:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 404A5384A034 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1588012434; bh=IloNFU3gZrm2UHiHGyCKLIfVUEeCapxH6ms2OKTgkiY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=NVWjogx6f5XLbCUEEd35Ag8MC51tCV+caCcC1wOfTdlpAgcJEYUxMaiI72Afz0+yR LsnRzdPk8ecw86viQ6WgMbk2mbLWVCAJuT3GCAwY8JuzCW2CG1ZjHZooASc0QkMmJi Ghuvz4FMhuTZJQtp9c2lj/v/AFGpvEXp+3N2nU1g= From: "bergner at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/94740] ICE on testsuite/gcc.dg/sso/t5.c with -mcpu=future -mpcrel -O1 Date: Mon, 27 Apr 2020 18:33:53 +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: 10.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: bergner 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: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc component 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, 27 Apr 2020 18:33:54 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94740 Peter Bergner changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |segher at gcc dot gnu.org Component|target |rtl-optimization --- Comment #5 from Peter Bergner --- Looking into this more, it seems the problem is that CSE creates a constant address and does not wrap it with a (const: ...). If the constant address = does have a (const: ) wrapper, then decompose_address handles this just fine. I= can modify the test case such that combine can combine our bswap load with a following insn and combine will call simplify_binary_operation on the addre= ss and it will create the (const: ) for us. CSE should probably do the same w= hen it creates a constant address. The following patch fixes the ICE for me. I'll run it through bootstrap and regtesting. diff --git a/gcc/cse.c b/gcc/cse.c index 5aaba8d80e0..870e2a21dbd 100644 --- a/gcc/cse.c +++ b/gcc/cse.c @@ -6328,6 +6328,14 @@ cse_process_notes (rtx x, rtx object, bool *changed) rtx new_rtx =3D cse_process_notes_1 (x, object, changed); if (new_rtx !=3D x) *changed =3D true; + if (*changed && object !=3D NULL_RTX && MEM_P (object)) + { + /* Call simplify_rtx on the updated address in case it is now + a constant and needs to be wrapped with a (const: ...). */ + rtx simplified_rtx =3D simplify_rtx (new_rtx); + if (simplified_rtx) + new_rtx =3D simplified_rtx; + } return new_rtx; }=