public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.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	[thread overview]
Message-ID: <bug-113921-4-dNc8c2Ls4m@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-113921-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113921

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vmakarov at gcc dot gnu.org

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
insn 49 above is inserted in
#1  0x0000000000d419db in emit_insn (x=0x7fffe6e921f8) at
../../gcc/emit-rtl.c:5106
#2  0x0000000001895ab7 in ix86_expand_move (mode=E_DImode,
operands=0x7fffffffd600) at ../../gcc/config/i386/i386-expand.c:368
#3  0x0000000001de4226 in gen_movdi (operand0=0x7fffe6ec8108,
operand1=0x7fffe6ec80f0) at ../../gcc/config/i386/i386.md:1935
#4  0x0000000000db804f in insn_gen_fn::operator()<rtx_def*, rtx_def*>
(this=0x2c6cd48 <insn_data+242536>) at ../../gcc/recog.h:407
#5  0x0000000000d8f394 in emit_move_insn_1 (x=0x7fffe6ec8108, y=0x7fffe6ec80f0)
at ../../gcc/expr.c:3766
#6  0x0000000000d8fe7a in emit_move_insn (x=0x7fffe6ec8108, y=0x7fffe6ec80f0)
at ../../gcc/expr.c:3936
#7  0x00000000013b8a75 in emit_partition_copy (dest=0x7fffe6ec8108,
src=0x7fffe6ec80f0, unsignedsrcp=1, sizeexp=<ssa_name 0x7fffe9cfc6c0 240>) at
../../gcc/tree-outof-ssa.c:259
#8  0x00000000013b8c5b in insert_partition_copy_on_edge (e=<edge 0x7fffe7314000
(138 -> 145)>, dest=72, src=71, locus=2147592841) at
../../gcc/tree-outof-ssa.c:293
#9  0x00000000013b9f0b in elim_create (g=0x7fffffffd8e0, T=72) at
../../gcc/tree-outof-ssa.c:729
#10 0x00000000013ba0ab in eliminate_phi (e=<edge 0x7fffe7314000 (138 -> 145)>,
g=0x7fffffffd8e0) at ../../gcc/tree-outof-ssa.c:771
#11 0x00000000013baaa5 in expand_phi_nodes (sa=0x3169360 <SA>) 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 which
presumably is what we'd want for the asm goto case.

  parent reply	other threads:[~2024-02-14 18:40 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-14 17:19 [Bug c/113921] New: " seanjc at google dot com
2024-02-14 18:00 ` [Bug middle-end/113921] " jakub at gcc dot gnu.org
2024-02-14 18:13 ` torvalds@linux-foundation.org
2024-02-14 18:16 ` torvalds@linux-foundation.org
2024-02-14 18:21 ` jakub at gcc dot gnu.org
2024-02-14 18:25 ` torvalds@linux-foundation.org
2024-02-14 18:40 ` jakub at gcc dot gnu.org [this message]
2024-02-14 19:07 ` jakub at gcc dot gnu.org
2024-02-14 20:31 ` jakub at gcc dot gnu.org
2024-02-15  8:00 ` rguenth at gcc dot gnu.org
2024-02-15  8:21 ` jakub at gcc dot gnu.org
2024-02-15 14:56 ` cvs-commit at gcc dot gnu.org
2024-02-15 15:14 ` cvs-commit at gcc dot gnu.org
2024-02-15 15:17 ` cvs-commit at gcc dot gnu.org
2024-02-15 15:20 ` cvs-commit at gcc dot gnu.org
2024-02-15 15:22 ` jakub at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-113921-4-dNc8c2Ls4m@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).