From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0B89B3861896; Tue, 5 Jan 2021 11:29:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0B89B3861896 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/97269] [11 Regression] ICE in change_address_1, at emit-rtl.c:2275 since r11-3427-ge94797250b403d66cb3624a594e41faf0dd76617 Date: Tue, 05 Jan 2021 11:29:51 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: rsandifo at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.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: Tue, 05 Jan 2021 11:29:52 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97269 --- Comment #3 from CVS Commits --- The master branch has been updated by Richard Sandiford : https://gcc.gnu.org/g:e8beba1cfc761cc35762283b3b44a355ef05e25b commit r11-6461-ge8beba1cfc761cc35762283b3b44a355ef05e25b Author: Richard Sandiford Date: Tue Jan 5 11:29:10 2021 +0000 explow, aarch64: Fix force-Pmode-to-mem for ILP32 [PR97269] This patch fixes a mode/rtx mismatch for ILP32 targets in: mem =3D force_const_mem (ptr_mode, imm); where imm can be Pmode rather than ptr_mode. The patch uses convert_memory_address to convert the Pmode address to ptr_mode before the call. However, immediate addresses can in general contain unspecs, and convert_memory_address wasn't set up to handle those. The patch therefore adds some generic unspec handling to convert_memory_address_addr_space_1. As the comment says, we can add a target hook if this behaviour turns out to be wrong for some targets. But I think what the patch does is a strict improvement over the status quo: without it, we would try to force the unspec into a register, but nevertheless wrap the result in a (const ...). That in turn would be invalid rtl and seems bound to generate an ICE later. I tested the explow.c part using -fstack-protector with local hacks to force SYMBOL_FORCE_TO_MEM for UNSPEC_SALT_ADDR. Fixes c-c++-common/torture/pr57945.c and various other tests. gcc/ PR target/97269 * explow.c (convert_memory_address_addr_space_1): Handle UNSPECs nested in CONSTs. * config/aarch64/aarch64.c (aarch64_expand_mov_immediate): Use convert_memory_address to convert symbolic immediates to ptr_mo= de before forcing them to memory.=