]> gcc.gnu.org Git - gcc.git/commit
regcprop: Avoid DCE of asm goto [PR100590]
authorJakub Jelinek <jakub@redhat.com>
Tue, 18 May 2021 08:26:45 +0000 (10:26 +0200)
committerJakub Jelinek <jakub@redhat.com>
Mon, 31 May 2021 11:52:58 +0000 (13:52 +0200)
commit490ffb47ad10df1793c4894c7c888d7a10576f1a
treea3eb81b83d76bc223d921a84684742656ec54dd9
parentc4d64d136e4e35fb2ee90771848944bb2ffeaf85
regcprop: Avoid DCE of asm goto [PR100590]

The following testcase ICEs, because copyprop_hardreg_forward_1 decides
to DCE asm goto with REG_UNUSED notes (because the output is unused and
asm isn't volatile).  But that DCE just removes the asm goto, leaving
a bb with two successors and no insn at the end that would allow that.

The following patch makes sure we drop that way only INSNs and not
JUMP_INSNs or CALL_INSNs.

2021-05-18  Jakub Jelinek  <jakub@redhat.com>

PR rtl-optimization/100590
* regcprop.c (copyprop_hardreg_forward_1): Only DCE dead sets if
they are NONJUMP_INSN_P.

* gcc.dg/pr100590.c: New test.

(cherry picked from commit c81704b359283bb54696755ead881ab04136da94)
gcc/regcprop.c
gcc/testsuite/gcc.dg/pr100590.c [new file with mode: 0644]
This page took 0.074883 seconds and 6 git commands to generate.