aboutsummaryrefslogtreecommitdiff
path: root/gcc/emit-rtl.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/emit-rtl.c')
-rw-r--r--gcc/emit-rtl.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index 3d6f73b..764a5ad 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -2667,9 +2667,8 @@ remove_unncessary_notes ()
rtx insn;
rtx next;
- /* Remove NOTE_INSN_DELETED notes. We must not remove the first
- instruction in the function because the compiler depends on the
- first instruction being a note. */
+ /* We must not remove the first instruction in the function because
+ the compiler depends on the first instruction being a note. */
for (insn = NEXT_INSN (get_insns ()); insn; insn = next)
{
/* Remember what's next. */
@@ -2679,6 +2678,14 @@ remove_unncessary_notes ()
if (GET_CODE (insn) != NOTE)
continue;
+ /* By now, all notes indicating lexical blocks should have
+ NOTE_BLOCK filled in. */
+ if ((NOTE_LINE_NUMBER (insn) == NOTE_INSN_BLOCK_BEG
+ || NOTE_LINE_NUMBER (insn) == NOTE_INSN_BLOCK_END)
+ && NOTE_BLOCK (insn) == NULL_TREE)
+ abort ();
+
+ /* Remove NOTE_INSN_DELETED notes. */
if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_DELETED)
remove_insn (insn);
else if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_BLOCK_END)