Commit 9392c110 by John Hassey

(reposition_prologue_and_epilogue_notes): Allow

for zero length prologue and epilogue list.

From-SVN: r3465
parent f3acae4d
...@@ -4750,7 +4750,8 @@ reposition_prologue_and_epilogue_notes (f) ...@@ -4750,7 +4750,8 @@ reposition_prologue_and_epilogue_notes (f)
reorg has run. */ reorg has run. */
for (len = 0; prologue[len]; len++) 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 (GET_CODE (insn) == NOTE)
{ {
if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_PROLOGUE_END) if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_PROLOGUE_END)
...@@ -4761,10 +4762,12 @@ reposition_prologue_and_epilogue_notes (f) ...@@ -4761,10 +4762,12 @@ reposition_prologue_and_epilogue_notes (f)
/* Find the prologue-end note if we haven't already, and /* Find the prologue-end note if we haven't already, and
move it to just after the last prologue insn. */ move it to just after the last prologue insn. */
if (note == 0) if (note == 0)
{
for (note = insn; note = NEXT_INSN (note);) for (note = insn; note = NEXT_INSN (note);)
if (GET_CODE (note) == NOTE if (GET_CODE (note) == NOTE
&& NOTE_LINE_NUMBER (note) == NOTE_INSN_PROLOGUE_END) && NOTE_LINE_NUMBER (note) == NOTE_INSN_PROLOGUE_END)
break; break;
}
next = NEXT_INSN (note); next = NEXT_INSN (note);
prev = PREV_INSN (note); prev = PREV_INSN (note);
if (prev) if (prev)
...@@ -4772,7 +4775,7 @@ reposition_prologue_and_epilogue_notes (f) ...@@ -4772,7 +4775,7 @@ reposition_prologue_and_epilogue_notes (f)
if (next) if (next)
PREV_INSN (next) = prev; PREV_INSN (next) = prev;
add_insn_after (note, insn); add_insn_after (note, insn);
break; }
} }
} }
...@@ -4785,7 +4788,8 @@ reposition_prologue_and_epilogue_notes (f) ...@@ -4785,7 +4788,8 @@ reposition_prologue_and_epilogue_notes (f)
reorg has run. */ reorg has run. */
for (len = 0; epilogue[len]; len++) 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 (GET_CODE (insn) == NOTE)
{ {
if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_EPILOGUE_BEG) if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_EPILOGUE_BEG)
...@@ -4796,10 +4800,12 @@ reposition_prologue_and_epilogue_notes (f) ...@@ -4796,10 +4800,12 @@ reposition_prologue_and_epilogue_notes (f)
/* Find the epilogue-begin note if we haven't already, and /* Find the epilogue-begin note if we haven't already, and
move it to just before the first epilogue insn. */ move it to just before the first epilogue insn. */
if (note == 0) if (note == 0)
{
for (note = insn; note = PREV_INSN (note);) for (note = insn; note = PREV_INSN (note);)
if (GET_CODE (note) == NOTE if (GET_CODE (note) == NOTE
&& NOTE_LINE_NUMBER (note) == NOTE_INSN_EPILOGUE_BEG) && NOTE_LINE_NUMBER (note) == NOTE_INSN_EPILOGUE_BEG)
break; break;
}
next = NEXT_INSN (note); next = NEXT_INSN (note);
prev = PREV_INSN (note); prev = PREV_INSN (note);
if (prev) if (prev)
...@@ -4807,7 +4813,7 @@ reposition_prologue_and_epilogue_notes (f) ...@@ -4807,7 +4813,7 @@ reposition_prologue_and_epilogue_notes (f)
if (next) if (next)
PREV_INSN (next) = prev; PREV_INSN (next) = prev;
add_insn_after (note, PREV_INSN (insn)); add_insn_after (note, PREV_INSN (insn));
break; }
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment