]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
loop-doloop.c (add_test): Only add jump notes if we did emit a jump.
authorNathan Sidwell <nathan@codesourcery.com>
Wed, 30 Nov 2005 11:12:36 +0000 (11:12 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Wed, 30 Nov 2005 11:12:36 +0000 (11:12 +0000)
* loop-doloop.c (add_test): Only add jump notes if we did emit a
jump.

From-SVN: r107713

gcc/ChangeLog
gcc/loop-doloop.c

index 8cf398be9a706b4f81a4c84807e70b398ce69225..ddb830f89b7bf0995780b8068f95d1d753b7b5ce 100644 (file)
@@ -1,3 +1,8 @@
+2005-11-30  Nathan Sidwell  <nathan@codesourcery.com>
+
+       * loop-doloop.c (add_test): Only add jump notes if we did emit a
+       jump.
+
 2005-11-30  Jeff Law  <law@redhat.com>
 
        * tree-ssa-uncprop.c (associate_equivalences_with_edges): Properly
index 280abddb24da6635fc8d8eda4c8a1bd1df047f09..3fcb79d9dc1fe7f16fcf4e39b36c2c2f1a7a7b0b 100644 (file)
@@ -244,14 +244,18 @@ add_test (rtx cond, basic_block bb, basic_block dest)
   do_compare_rtx_and_jump (op0, op1, code, 0, mode, NULL_RTX, NULL_RTX, label);
 
   jump = get_last_insn ();
-  JUMP_LABEL (jump) = label;
+  /* It is possible for the jump to be optimized out.  */
+  if (JUMP_P (jump))
+    {
+      JUMP_LABEL (jump) = label;
 
-  /* The jump is supposed to handle an unlikely special case.  */
-  REG_NOTES (jump)
-         = gen_rtx_EXPR_LIST (REG_BR_PROB,
-                              const0_rtx, REG_NOTES (jump));
+       /* The jump is supposed to handle an unlikely special case.  */
+      REG_NOTES (jump)
+       = gen_rtx_EXPR_LIST (REG_BR_PROB,
+                            const0_rtx, REG_NOTES (jump));
 
-  LABEL_NUSES (label)++;
+      LABEL_NUSES (label)++;
+    }
 
   seq = get_insns ();
   end_sequence ();