(reposition_prologue_and_epilogue_notes): Allow
for zero length prologue and epilogue list. From-SVN: r3465
This commit is contained in:
parent
f3acae4d7c
commit
9392c110eb
|
@ -4750,7 +4750,8 @@ reposition_prologue_and_epilogue_notes (f)
|
|||
reorg has run. */
|
||||
for (len = 0; prologue[len]; len++)
|
||||
;
|
||||
for (insn = f; insn; insn = NEXT_INSN (insn))
|
||||
for (insn = f; len && insn; insn = NEXT_INSN (insn))
|
||||
{
|
||||
if (GET_CODE (insn) == NOTE)
|
||||
{
|
||||
if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_PROLOGUE_END)
|
||||
|
@ -4761,10 +4762,12 @@ reposition_prologue_and_epilogue_notes (f)
|
|||
/* Find the prologue-end note if we haven't already, and
|
||||
move it to just after the last prologue insn. */
|
||||
if (note == 0)
|
||||
{
|
||||
for (note = insn; note = NEXT_INSN (note);)
|
||||
if (GET_CODE (note) == NOTE
|
||||
&& NOTE_LINE_NUMBER (note) == NOTE_INSN_PROLOGUE_END)
|
||||
break;
|
||||
}
|
||||
next = NEXT_INSN (note);
|
||||
prev = PREV_INSN (note);
|
||||
if (prev)
|
||||
|
@ -4772,7 +4775,7 @@ reposition_prologue_and_epilogue_notes (f)
|
|||
if (next)
|
||||
PREV_INSN (next) = prev;
|
||||
add_insn_after (note, insn);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4785,7 +4788,8 @@ reposition_prologue_and_epilogue_notes (f)
|
|||
reorg has run. */
|
||||
for (len = 0; epilogue[len]; len++)
|
||||
;
|
||||
for (insn = get_last_insn (); insn; insn = PREV_INSN (insn))
|
||||
for (insn = get_last_insn (); len && insn; insn = PREV_INSN (insn))
|
||||
{
|
||||
if (GET_CODE (insn) == NOTE)
|
||||
{
|
||||
if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_EPILOGUE_BEG)
|
||||
|
@ -4796,10 +4800,12 @@ reposition_prologue_and_epilogue_notes (f)
|
|||
/* Find the epilogue-begin note if we haven't already, and
|
||||
move it to just before the first epilogue insn. */
|
||||
if (note == 0)
|
||||
{
|
||||
for (note = insn; note = PREV_INSN (note);)
|
||||
if (GET_CODE (note) == NOTE
|
||||
&& NOTE_LINE_NUMBER (note) == NOTE_INSN_EPILOGUE_BEG)
|
||||
break;
|
||||
}
|
||||
next = NEXT_INSN (note);
|
||||
prev = PREV_INSN (note);
|
||||
if (prev)
|
||||
|
@ -4807,7 +4813,7 @@ reposition_prologue_and_epilogue_notes (f)
|
|||
if (next)
|
||||
PREV_INSN (next) = prev;
|
||||
add_insn_after (note, PREV_INSN (insn));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue