diff options
author | Bernd Schmidt <bernds@redhat.com> | 2016-11-07 17:03:55 +0000 |
---|---|---|
committer | Bernd Schmidt <bernds@gcc.gnu.org> | 2016-11-07 17:03:55 +0000 |
commit | 1581a12c3577a2d9048d47b0b7205df772c308db (patch) | |
tree | e4c649d63cdbc46e4c05389eea601fa29f22b40a /gcc/sel-sched-ir.c | |
parent | caa024ffce186dc6ce7ee8217d5d50d7f9a091e0 (diff) | |
download | gcc-1581a12c3577a2d9048d47b0b7205df772c308db.zip gcc-1581a12c3577a2d9048d47b0b7205df772c308db.tar.gz gcc-1581a12c3577a2d9048d47b0b7205df772c308db.tar.bz2 |
emit-rtl.c (emit_copy_of_insn_after): Duplicate notes in order.
* emit-rtl.c (emit_copy_of_insn_after): Duplicate notes in order.
* sel-sched-ir.c (create_copy_of_insn_rtx): Likewise.
* rtl.h (duplicate_reg_notes): Declare.
* rtlanal.c (duplicate_reg_note): New function.
From-SVN: r241913
Diffstat (limited to 'gcc/sel-sched-ir.c')
-rw-r--r-- | gcc/sel-sched-ir.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/gcc/sel-sched-ir.c b/gcc/sel-sched-ir.c index 26bc142..02157b4 100644 --- a/gcc/sel-sched-ir.c +++ b/gcc/sel-sched-ir.c @@ -5762,6 +5762,11 @@ create_copy_of_insn_rtx (rtx insn_rtx) res = create_insn_rtx_from_pattern (copy_rtx (PATTERN (insn_rtx)), NULL_RTX); + /* Locate the end of existing REG_NOTES in NEW_RTX. */ + rtx *ptail = ®_NOTES (res); + while (*ptail != NULL_RTX) + ptail = &XEXP (*ptail, 1); + /* Copy all REG_NOTES except REG_EQUAL/REG_EQUIV and REG_LABEL_OPERAND since mark_jump_label will make them. REG_LABEL_TARGETs are created there too, but are supposed to be sticky, so we copy them. */ @@ -5770,11 +5775,8 @@ create_copy_of_insn_rtx (rtx insn_rtx) && REG_NOTE_KIND (link) != REG_EQUAL && REG_NOTE_KIND (link) != REG_EQUIV) { - if (GET_CODE (link) == EXPR_LIST) - add_reg_note (res, REG_NOTE_KIND (link), - copy_insn_1 (XEXP (link, 0))); - else - add_reg_note (res, REG_NOTE_KIND (link), XEXP (link, 0)); + *ptail = duplicate_reg_note (link); + ptail = &XEXP (*ptail, 1); } return res; |