diff options
author | Andrew Pinski <apinski@marvell.com> | 2020-03-06 08:34:01 -0700 |
---|---|---|
committer | Jeff Law <law@redhat.com> | 2020-03-06 08:35:18 -0700 |
commit | e6ce69cae5059dfd715edd4e26653c23baf4cb0f (patch) | |
tree | ec76a8da855de110091e86a81e40108ac182b173 | |
parent | 4b62b3960ec405c6ed226a7763e0905c434cb2bb (diff) | |
download | gcc-e6ce69cae5059dfd715edd4e26653c23baf4cb0f.zip gcc-e6ce69cae5059dfd715edd4e26653c23baf4cb0f.tar.gz gcc-e6ce69cae5059dfd715edd4e26653c23baf4cb0f.tar.bz2 |
Avoid putting a REG_NOTE on anything other than an INSN in haifa-sched.c
PR rtl-optimization/93996
* haifa-sched.c (remove_notes): Be more careful when adding
REG_SAVE_NOTE.
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/haifa-sched.c | 9 |
2 files changed, 16 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8436483..e38af8e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2020-03-06 Andrew Pinski <apinski@marvell.com> + Jeff Law <law@redhat.com> + + PR rtl-optimization/93996 + * haifa-sched.c (remove_notes): Be more careful when adding + REG_SAVE_NOTE. + 2020-03-06 Delia Burduv <delia.burduv@arm.com> * config/arm/arm_neon.h (vld2_bf16): New. diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c index 1d3de7b..80687fb 100644 --- a/gcc/haifa-sched.c +++ b/gcc/haifa-sched.c @@ -4239,6 +4239,15 @@ remove_notes (rtx_insn *head, rtx_insn *tail) if (insn != tail) { remove_insn (insn); + /* If an insn was split just before the EPILOGUE_BEG note and + that split created new basic blocks, we could have a + BASIC_BLOCK note here. Safely advance over it in that case + and assert that we land on a real insn. */ + if (NOTE_P (next) + && NOTE_KIND (next) == NOTE_INSN_BASIC_BLOCK + && next != next_tail) + next = NEXT_INSN (next); + gcc_assert (INSN_P (next)); add_reg_note (next, REG_SAVE_NOTE, GEN_INT (NOTE_INSN_EPILOGUE_BEG)); break; |