diff options
author | geoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-02-25 18:17:40 +0000 |
---|---|---|
committer | geoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-02-25 18:17:40 +0000 |
commit | 9dcd77b5d4ba45bea3176e89f83f4ef8168cfe1e (patch) | |
tree | 52960c4466687daba4dc5334903af1dc32a07a13 /gcc/haifa-sched.c | |
parent | 27152175afaa6d850b720d7b50892253187e2914 (diff) | |
download | gcc-9dcd77b5d4ba45bea3176e89f83f4ef8168cfe1e.tar.gz |
* haifa-sched.c (schedule_block): Explain the real reason
we delete REG_SAVE_NOTEs on the first insn of a block.
Don't delete REG_SAVE_NOTES for NOTE_INSN_SETJMP.
* compile/20000224-1.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@32150 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/haifa-sched.c')
-rw-r--r-- | gcc/haifa-sched.c | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c index 939ddab2715..ae81a259d3e 100644 --- a/gcc/haifa-sched.c +++ b/gcc/haifa-sched.c @@ -5744,22 +5744,31 @@ schedule_block (bb, rgn_n_insns) had different notions of what the "head" insn was. */ get_bb_head_tail (bb, &head, &tail); - /* Interblock scheduling could have moved the original head insn from this - block into a proceeding block. This may also cause schedule_block and - compute_forward_dependences to have different notions of what the - "head" insn was. - - If the interblock movement happened to make this block start with - some notes (LOOP, EH or SETJMP) before the first real insn, then - HEAD will have various special notes attached to it which must be - removed so that we don't end up with extra copies of the notes. */ + /* rm_other_notes only removes notes which are _inside_ the + block---that is, it won't remove notes before the first real insn + or after the last real insn of the block. So if the first insn + has a REG_SAVE_NOTE which would otherwise be emitted before the + insn, it is redundant with the note before the start of the + block, and so we have to take it out. + + FIXME: Probably the same thing should be done with REG_SAVE_NOTEs + referencing NOTE_INSN_SETJMP at the end of the block. */ if (GET_RTX_CLASS (GET_CODE (head)) == 'i') { rtx note; for (note = REG_NOTES (head); note; note = XEXP (note, 1)) if (REG_NOTE_KIND (note) == REG_SAVE_NOTE) - remove_note (head, note); + { + if (INTVAL (XEXP (note, 0)) != NOTE_INSN_SETJMP) + { + remove_note (head, note); + note = XEXP (note, 1); + remove_note (head, note); + } + else + note = XEXP (note, 1); + } } next_tail = NEXT_INSN (tail); |