Make a temporary sequence for a jump emitted only to examine its length.
authorBernd Schmidt <bernds@codesourcery.com>
Tue, 4 Nov 2014 15:25:37 +0000 (15:25 +0000)
committerBernd Schmidt <bernds@gcc.gnu.org>
Tue, 4 Nov 2014 15:25:37 +0000 (15:25 +0000)
* bb-reorder.c (get_uncond_jump_length): Avoid using delete_insn,
emit into a sequence instead.

From-SVN: r217088

gcc/ChangeLog
gcc/bb-reorder.c

index d7746a92689c6add4d7d915b7b0cad878ffa4869..e5f0c4621aa4b01a317392c5a2d7f500e6ee1e8c 100644 (file)
@@ -1,3 +1,8 @@
+2014-11-04  Bernd Schmidt  <bernds@codesourcery.com>
+
+       * bb-reorder.c (get_uncond_jump_length): Avoid using delete_insn,
+       emit into a sequence instead.
+
 2014-11-04  Jan-Benedict Glaw  <jbglaw@lug-owl.de>
 
        * config/sh/sh.c (emit_fpu_switch): Drop unused automatic variable.
index 84191e4a6f577e8a543e6067b4f149ead03346f5..1f7c3ee1749185f79c3b42f4a20d8e586ce9b1e7 100644 (file)
@@ -1393,13 +1393,12 @@ get_uncond_jump_length (void)
   rtx_insn *label, *jump;
   int length;
 
-  label = emit_label_before (gen_label_rtx (), get_insns ());
+  start_sequence ();
+  label = emit_label (gen_label_rtx ());
   jump = emit_jump_insn (gen_jump (label));
-
   length = get_attr_min_length (jump);
+  end_sequence ();
 
-  delete_insn (jump);
-  delete_insn (label);
   return length;
 }