]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
emit-rtl.c (emit_label_before): Do not allow the same label to be emitted twice.
authorSteven Bosscher <steven@gcc.gnu.org>
Mon, 16 Jul 2012 11:43:47 +0000 (11:43 +0000)
committerSteven Bosscher <steven@gcc.gnu.org>
Mon, 16 Jul 2012 11:43:47 +0000 (11:43 +0000)
* emit-rtl.c (emit_label_before): Do not allow the same label
to be emitted twice.
(emit_label_after): Likewise.
(emit_label): Likewise.

From-SVN: r189521

gcc/ChangeLog
gcc/emit-rtl.c

index 771bc0d1b385f701b46c4dc210ed7934143cf008..985bbdc5b9ace17d7af35846576941745a2b2da5 100644 (file)
@@ -1,5 +1,10 @@
 2012-07-16  Steven Bosscher  <steven@gcc.gnu.org>
 
+       * emit-rtl.c (emit_label_before): Do not allow the same label
+        to be emitted twice.
+       (emit_label_after): Likewise.
+       (emit_label): Likewise.
+
        * flags.h (TYPE_OVERFLOW_WRAPS, TYPE_OVERFLOW_UNDEFINED,
        TYPE_OVERFLOW_TRAPS, POINTER_TYPE_OVERFLOW_UNDEFINED): Move to tree.h.
        * tree.h (TYPE_OVERFLOW_WRAPS, TYPE_OVERFLOW_UNDEFINED,
index f0cbdb80f7b6a01ebb0c0c20c5a1dcfeb6abce76..3431e98385b33cecb9d0b29e1764835f500f69e5 100644 (file)
@@ -4220,14 +4220,9 @@ emit_barrier_before (rtx before)
 rtx
 emit_label_before (rtx label, rtx before)
 {
-  /* This can be called twice for the same label as a result of the
-     confusion that follows a syntax error!  So make it harmless.  */
-  if (INSN_UID (label) == 0)
-    {
-      INSN_UID (label) = cur_insn_uid++;
-      add_insn_before (label, before, NULL);
-    }
-
+  gcc_checking_assert (INSN_UID (label) == 0);
+  INSN_UID (label) = cur_insn_uid++;
+  add_insn_before (label, before, NULL);
   return label;
 }
 
@@ -4386,15 +4381,9 @@ emit_barrier_after (rtx after)
 rtx
 emit_label_after (rtx label, rtx after)
 {
-  /* This can be called twice for the same label
-     as a result of the confusion that follows a syntax error!
-     So make it harmless.  */
-  if (INSN_UID (label) == 0)
-    {
-      INSN_UID (label) = cur_insn_uid++;
-      add_insn_after (label, after, NULL);
-    }
-
+  gcc_checking_assert (INSN_UID (label) == 0);
+  INSN_UID (label) = cur_insn_uid++;
+  add_insn_after (label, after, NULL);
   return label;
 }
 
@@ -4810,14 +4799,9 @@ emit_call_insn (rtx x)
 rtx
 emit_label (rtx label)
 {
-  /* This can be called twice for the same label
-     as a result of the confusion that follows a syntax error!
-     So make it harmless.  */
-  if (INSN_UID (label) == 0)
-    {
-      INSN_UID (label) = cur_insn_uid++;
-      add_insn (label);
-    }
+  gcc_checking_assert (INSN_UID (label) == 0);
+  INSN_UID (label) = cur_insn_uid++;
+  add_insn (label);
   return label;
 }