aboutsummaryrefslogtreecommitdiff
path: root/gcc/haifa-sched.c
diff options
context:
space:
mode:
authorGeoff Keating <geoffk@cygnus.com>2000-02-25 18:17:40 +0000
committerGeoffrey Keating <geoffk@gcc.gnu.org>2000-02-25 18:17:40 +0000
commit0e2eaba46d7ef44ca821d3afaf385809db84fb1f (patch)
tree52960c4466687daba4dc5334903af1dc32a07a13 /gcc/haifa-sched.c
parent66830bb21b32a9cd5c5e81e085bbafe7edca55fd (diff)
downloadgcc-0e2eaba46d7ef44ca821d3afaf385809db84fb1f.zip
gcc-0e2eaba46d7ef44ca821d3afaf385809db84fb1f.tar.gz
gcc-0e2eaba46d7ef44ca821d3afaf385809db84fb1f.tar.bz2
haifa-sched.c (schedule_block): Explain the real reason we delete REG_SAVE_NOTEs on the first insn of a block.
* 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. From-SVN: r32150
Diffstat (limited to 'gcc/haifa-sched.c')
-rw-r--r--gcc/haifa-sched.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c
index 939ddab..ae81a25 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);