aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Henderson <rth@cygnus.com>2000-05-27 13:10:38 -0700
committerRichard Henderson <rth@gcc.gnu.org>2000-05-27 13:10:38 -0700
commit30196c1ff4ff35c7d46be079c0b6466e9203a784 (patch)
tree505a94fbe12c6bc641f5eef7af5da579dd6d4d3a
parent892ecf921f5bb5af0e03290433dc2e7dce487ff7 (diff)
downloadgcc-30196c1ff4ff35c7d46be079c0b6466e9203a784.zip
gcc-30196c1ff4ff35c7d46be079c0b6466e9203a784.tar.gz
gcc-30196c1ff4ff35c7d46be079c0b6466e9203a784.tar.bz2
function.c (thread_prologue_epilogue_insns): Don't move the line note at the head of the chain.
* function.c (thread_prologue_epilogue_insns): Don't move the line note at the head of the chain. Only force a lineno note before the end of block 0. From-SVN: r34207
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/function.c51
2 files changed, 33 insertions, 24 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 74b7cb3..6dfc954 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
2000-05-27 Richard Henderson <rth@cygnus.com>
+ * function.c (thread_prologue_epilogue_insns): Don't move the
+ line note at the head of the chain. Only force a lineno note
+ before the end of block 0.
+
+2000-05-27 Richard Henderson <rth@cygnus.com>
+
* gensupport.c (collect_insn_data): Record the maximum number
of alternatives, not the last seen.
diff --git a/gcc/function.c b/gcc/function.c
index 63634bb..a59de4b 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -7038,10 +7038,11 @@ epilogue_done:
rtx insn, prev;
/* GDB handles `break f' by setting a breakpoint on the first
- line note *after* the prologue. Which means (1) that if
+ line note after the prologue. Which means (1) that if
there are line number notes before where we inserted the
- prologue we should move them, and (2) if there is no such
- note, then we should generate one at the prologue. */
+ prologue we should move them, and (2) we should generate a
+ note before the end of the first basic block, if there isn't
+ one already there. */
for (insn = prologue_end; insn ; insn = prev)
{
@@ -7050,32 +7051,34 @@ epilogue_done:
{
/* Note that we cannot reorder the first insn in the
chain, since rest_of_compilation relies on that
- remaining constant. Do the next best thing. */
+ remaining constant. */
if (prev == NULL)
- {
- emit_line_note_after (NOTE_SOURCE_FILE (insn),
- NOTE_LINE_NUMBER (insn),
- prologue_end);
- NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
- }
- else
- reorder_insns (insn, insn, prologue_end);
+ break;
+ reorder_insns (insn, insn, prologue_end);
}
}
- insn = NEXT_INSN (prologue_end);
- if (! insn || GET_CODE (insn) != NOTE || NOTE_LINE_NUMBER (insn) <= 0)
+ /* Find the last line number note in the first block. */
+ for (insn = BASIC_BLOCK (0)->end;
+ insn != prologue_end;
+ insn = PREV_INSN (insn))
+ if (GET_CODE (insn) == NOTE && NOTE_LINE_NUMBER (insn) > 0)
+ break;
+
+ /* If we didn't find one, make a copy of the first line number
+ we run across. */
+ if (! insn)
{
- for (insn = next_active_insn (f); insn ; insn = PREV_INSN (insn))
- {
- if (GET_CODE (insn) == NOTE && NOTE_LINE_NUMBER (insn) > 0)
- {
- emit_line_note_after (NOTE_SOURCE_FILE (insn),
- NOTE_LINE_NUMBER (insn),
- prologue_end);
- break;
- }
- }
+ for (insn = next_active_insn (prologue_end);
+ insn;
+ insn = PREV_INSN (insn))
+ if (GET_CODE (insn) == NOTE && NOTE_LINE_NUMBER (insn) > 0)
+ {
+ emit_line_note_after (NOTE_SOURCE_FILE (insn),
+ NOTE_LINE_NUMBER (insn),
+ prologue_end);
+ break;
+ }
}
}
#endif