re PR target/46546 (ix86_pad_returns may leave BB_END (bb) pointing to deleted insn)
authorUros Bizjak <ubizjak@gmail.com>
Thu, 18 Nov 2010 23:46:13 +0000 (00:46 +0100)
committerUros Bizjak <uros@gcc.gnu.org>
Thu, 18 Nov 2010 23:46:13 +0000 (00:46 +0100)
PR target/46546
* config/i386/i386.c (ix86_reorg): Call compute_bb_for_insn.

From-SVN: r166921

gcc/ChangeLog
gcc/config/i386/i386.c

index 62adb269db068be134ea173d2ddbc138ecc71556..f5b80283e9d50bbf68ff126e78d2a1d337303ced 100644 (file)
@@ -1,3 +1,8 @@
+2010-11-19  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR target/46546
+       * config/i386/i386.c (ix86_reorg): Call compute_bb_for_insn.
+
 2010-11-18  Richard Henderson  <rth@redhat.com>
 
        PR middle-end/46515
index 11820cfe6ced7551180c9145e387637d5c5c790f..d5f097d5253f17318970ef3503f473a431a1a3c7 100644 (file)
@@ -29633,8 +29633,8 @@ ix86_pad_returns (void)
              && ((JUMP_P (prev) && any_condjump_p (prev))
                  || CALL_P (prev)))
            replace = true;
-         /* Empty functions get branch mispredict even when the jump destination
-            is not visible to us.  */
+         /* Empty functions get branch mispredict even when
+            the jump destination is not visible to us.  */
          if (!prev && !optimize_function_for_size_p (cfun))
            replace = true;
        }
@@ -29752,8 +29752,8 @@ ix86_pad_short_function (void)
              if (!insn)
                insn = ret;
 
-             /* Two NOPs are counted as one instruction.  */
-             insn_count = 2 * (4  - insn_count);
+             /* Two NOPs count as one instruction.  */
+             insn_count = 2 * (4 - insn_count);
              emit_insn_before (gen_nops (GEN_INT (insn_count)), insn);
            }
        }
@@ -29765,6 +29765,10 @@ ix86_pad_short_function (void)
 static void
 ix86_reorg (void)
 {
+  /* We are freeing block_for_insn in the toplev to keep compatibility
+     with old MDEP_REORGS that are not CFG based.  Recompute it now.  */
+  compute_bb_for_insn ();
+
   if (optimize && optimize_function_for_speed_p (cfun))
     {
       if (TARGET_PAD_SHORT_FUNCTION)