diff options
author | Uros Bizjak <ubizjak@gmail.com> | 2010-11-19 00:46:13 +0100 |
---|---|---|
committer | Uros Bizjak <uros@gcc.gnu.org> | 2010-11-19 00:46:13 +0100 |
commit | 77841d771721ca0e36c031cf9a004005b0bec18e (patch) | |
tree | e55ae609ec6efc045afb2cf8b0d5c569fcf163fe | |
parent | cd400280c4f431ef4873b68c63f12d3f7ada87aa (diff) | |
download | gcc-77841d771721ca0e36c031cf9a004005b0bec18e.zip gcc-77841d771721ca0e36c031cf9a004005b0bec18e.tar.gz gcc-77841d771721ca0e36c031cf9a004005b0bec18e.tar.bz2 |
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
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/config/i386/i386.c | 12 |
2 files changed, 13 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 62adb26..f5b8028 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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 diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 11820cf..d5f097d 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) |