From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DADD6384A01C; Fri, 8 Jan 2021 14:19:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DADD6384A01C From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/98603] aarch64: ICE in extract_insn (ira) on asm goto with bad constraint Date: Fri, 08 Jan 2021 14:19: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: 11.0 X-Bugzilla-Keywords: error-recovery X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED 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 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, 08 Jan 2021 14:19:54 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98603 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org, | |vmakarov at gcc dot gnu.org --- Comment #1 from Jakub Jelinek --- The bug is function.c (instantiate_virtual_regs_in_insn): if (!check_asm_operands (PATTERN (insn))) { error_for_asm (insn, "impossible constraint in %"); /* For asm goto, instead of fixing up all the edges just clear the template and clear input operands (asm goto doesn't have any output operands). */ if (JUMP_P (insn)) { rtx asm_op =3D extract_asm_operands (PATTERN (insn)); ASM_OPERANDS_TEMPLATE (asm_op) =3D ggc_strdup (""); ASM_OPERANDS_INPUT_VEC (asm_op) =3D rtvec_alloc (0); ASM_OPERANDS_INPUT_CONSTRAINT_VEC (asm_op) =3D rtvec_alloc (0= ); } else delete_insn (insn); } As the comment documents, that was correct before support for outputs in asm goto has been added, but for asm insn with outputs, there are multiple problems. One is that extract_asm_operands extracts just one of the ASM_OPERANDS, but with multiple outputs there can be several, and those need to be handled in sync. And the other is that we still keep the incorrectly constrained outputs if = any in the IL.=