loop-unswitch.c (compare_and_jump_seq): Assert that the last insn in the sequence...
authorNick Clifton <nickc@redhat.com>
Thu, 24 Jun 2010 10:01:57 +0000 (10:01 +0000)
committerNick Clifton <nickc@gcc.gnu.org>
Thu, 24 Jun 2010 10:01:57 +0000 (10:01 +0000)
        * loop-unswitch.c (compare_and_jump_seq): Assert that the last
        insn in the sequence is a jump insn before setting its label.

From-SVN: r161313

gcc/ChangeLog
gcc/loop-unswitch.c

index 9d33f3a94fd1e06ba0e27c87e51d5392d0fc2925..e9c077124bd6db2f0f959cd30e736eaf8c608e20 100644 (file)
@@ -1,3 +1,8 @@
+2010-06-24  Nick Clifton<nickc@redhat.com>
+
+       * loop-unswitch.c (compare_and_jump_seq): Assert that the last
+       insn in the sequence is a jump insn before setting its label.
+
 2010-06-24  Alan Modra  <amodra@gmail.com>
 
        * collect2.c (main): Match exactly --version and --help.
index edf62fa8aa8f7061f912ddbec3ef4fe1af499a45..77524d8bfe39ca299ec3be230665438fc28484b3 100644 (file)
@@ -110,6 +110,7 @@ compare_and_jump_seq (rtx op0, rtx op1, enum rtx_code comp, rtx label, int prob,
       gcc_assert (rtx_equal_p (op1, XEXP (cond, 1)));
       emit_jump_insn (copy_insn (PATTERN (cinsn)));
       jump = get_last_insn ();
+      gcc_assert (JUMP_P (jump));
       JUMP_LABEL (jump) = JUMP_LABEL (cinsn);
       LABEL_NUSES (JUMP_LABEL (jump))++;
       redirect_jump (jump, label, 0);
@@ -123,6 +124,7 @@ compare_and_jump_seq (rtx op0, rtx op1, enum rtx_code comp, rtx label, int prob,
       do_compare_rtx_and_jump (op0, op1, comp, 0,
                               mode, NULL_RTX, NULL_RTX, label, -1);
       jump = get_last_insn ();
+      gcc_assert (JUMP_P (jump));
       JUMP_LABEL (jump) = label;
       LABEL_NUSES (label)++;
     }