summaryrefslogtreecommitdiffstats
path: root/contrib/gcc/function.c
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2000-05-27 02:43:50 +0000
committerobrien <obrien@FreeBSD.org>2000-05-27 02:43:50 +0000
commit797ccd6333f01cbf4e77f65a6400e825d04257cd (patch)
tree63fe65f03181fdf1e4e58df8070a9c2001b37e3d /contrib/gcc/function.c
parent2213994dde95f9976af97c2acabf8054049ba10a (diff)
downloadFreeBSD-src-797ccd6333f01cbf4e77f65a6400e825d04257cd.zip
FreeBSD-src-797ccd6333f01cbf4e77f65a6400e825d04257cd.tar.gz
Fix conflicts.
Diffstat (limited to 'contrib/gcc/function.c')
-rw-r--r--contrib/gcc/function.c59
1 files changed, 55 insertions, 4 deletions
diff --git a/contrib/gcc/function.c b/contrib/gcc/function.c
index e597d33..cd8f249 100644
--- a/contrib/gcc/function.c
+++ b/contrib/gcc/function.c
@@ -6704,7 +6704,10 @@ void
thread_prologue_and_epilogue_insns (f)
rtx f ATTRIBUTE_UNUSED;
{
- int insertted = 0;
+ int inserted = 0;
+#ifdef HAVE_prologue
+ rtx prologue_end = NULL_RTX;
+#endif
prologue = 0;
#ifdef HAVE_prologue
@@ -6721,7 +6724,7 @@ thread_prologue_and_epilogue_insns (f)
seq = get_insns ();
prologue = record_insns (seq);
- emit_note (NULL, NOTE_INSN_PROLOGUE_END);
+ prologue_end = emit_note (NULL, NOTE_INSN_PROLOGUE_END);
seq = gen_sequence ();
end_sequence ();
@@ -6734,7 +6737,7 @@ thread_prologue_and_epilogue_insns (f)
abort ();
insert_insn_on_edge (seq, ENTRY_BLOCK_PTR->succ);
- insertted = 1;
+ inserted = 1;
}
else
emit_insn_after (seq, f);
@@ -6866,8 +6869,56 @@ thread_prologue_and_epilogue_insns (f)
}
#endif
- if (insertted)
+ if (inserted)
commit_edge_insertions ();
+
+#ifdef HAVE_prologue
+ if (prologue_end)
+ {
+ rtx insn, prev;
+
+ /* GDB handles `break f' by setting a breakpoint on the first
+ 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. */
+
+ for (insn = prologue_end; insn ; insn = prev)
+ {
+ prev = PREV_INSN (insn);
+ if (GET_CODE (insn) == NOTE && NOTE_LINE_NUMBER (insn) > 0)
+ {
+ /* 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. */
+ 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);
+ }
+ }
+
+ insn = NEXT_INSN (prologue_end);
+ if (! insn || GET_CODE (insn) != NOTE || NOTE_LINE_NUMBER (insn) <= 0)
+ {
+ 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;
+ }
+ }
+ }
+ }
+ #endif
}
/* Reposition the prologue-end and epilogue-begin notes after instruction
OpenPOWER on IntegriCloud