From: Uros Bizjak Date: Thu, 18 Nov 2010 23:46:13 +0000 (+0100) Subject: re PR target/46546 (ix86_pad_returns may leave BB_END (bb) pointing to deleted insn) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=77841d771721ca0e36c031cf9a004005b0bec18e;p=gcc.git re PR target/46546 (ix86_pad_returns may leave BB_END (bb) pointing to deleted insn) PR target/46546 * config/i386/i386.c (ix86_reorg): Call compute_bb_for_insn. From-SVN: r166921 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 62adb269db0..f5b80283e9d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2010-11-19 Uros Bizjak + + PR target/46546 + * config/i386/i386.c (ix86_reorg): Call compute_bb_for_insn. + 2010-11-18 Richard Henderson PR middle-end/46515 diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 11820cfe6ce..d5f097d5253 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -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)