From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5D9AA3860C31; Wed, 14 Feb 2024 18:40:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5D9AA3860C31 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1707936007; bh=VYRijV0clf3XWgv7xVk6ZRnx59RCGqt7QALMlMp0A1M=; h=From:To:Subject:Date:In-Reply-To:References:From; b=cAr1si2qlWVqBBAodPQW+gQMGjAj8XUtNMw1/GPlcWQhvXcvFvF0Kv34X9xVJMfDM 4hkRUs73y9RsuAqhC3hSJb84cOWnPNYrBDLwcbzOf7eZB7T8aJiPD0eRgu0dMHckSl 7kgtjrUYpxrB8Vi9r6DWVDsNEw2zz9RjDV1mnL4I= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/113921] Output register of an "asm volatile goto" is incorrectly clobbered/discarded Date: Wed, 14 Feb 2024 18:40:06 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 11.4.0 X-Bugzilla-Keywords: inline-asm 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D113921 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |vmakarov at gcc dot gnu.org --- Comment #6 from Jakub Jelinek --- insn 49 above is inserted in #1 0x0000000000d419db in emit_insn (x=3D0x7fffe6e921f8) at ../../gcc/emit-rtl.c:5106 #2 0x0000000001895ab7 in ix86_expand_move (mode=3DE_DImode, operands=3D0x7fffffffd600) at ../../gcc/config/i386/i386-expand.c:368 #3 0x0000000001de4226 in gen_movdi (operand0=3D0x7fffe6ec8108, operand1=3D0x7fffe6ec80f0) at ../../gcc/config/i386/i386.md:1935 #4 0x0000000000db804f in insn_gen_fn::operator() (this=3D0x2c6cd48 ) at ../../gcc/recog.h:407 #5 0x0000000000d8f394 in emit_move_insn_1 (x=3D0x7fffe6ec8108, y=3D0x7fffe= 6ec80f0) at ../../gcc/expr.c:3766 #6 0x0000000000d8fe7a in emit_move_insn (x=3D0x7fffe6ec8108, y=3D0x7fffe6e= c80f0) at ../../gcc/expr.c:3936 #7 0x00000000013b8a75 in emit_partition_copy (dest=3D0x7fffe6ec8108, src=3D0x7fffe6ec80f0, unsignedsrcp=3D1, sizeexp=3D) at ../../gcc/tree-outof-ssa.c:259 #8 0x00000000013b8c5b in insert_partition_copy_on_edge (e=3D 145)>, dest=3D72, src=3D71, locus=3D2147592841) at ../../gcc/tree-outof-ssa.c:293 #9 0x00000000013b9f0b in elim_create (g=3D0x7fffffffd8e0, T=3D72) at ../../gcc/tree-outof-ssa.c:729 #10 0x00000000013ba0ab in eliminate_phi (e=3D 1= 45)>, g=3D0x7fffffffd8e0) at ../../gcc/tree-outof-ssa.c:771 #11 0x00000000013baaa5 in expand_phi_nodes (sa=3D0x3169360 ) at ../../gcc/tree-outof-ssa.c:1024 later on insert_partition_copy_on_edge will insert_insn_on_edge on the 138 = -> 145 edge, but the insertion remains uncommitted. Later on the asm goto expansion copies after_rtl_seq which contains (set (reg:DI 151) (reg:DI 385)) and calls insert_insn_on_edge on it too. But insert_insn_on_edge appends to the e->insns.r rather than prepends it w= hich presumably is what we'd want for the asm goto case.=