http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60520
--- Comment #4 from H.J. Lu <hjl.tools at gmail dot com> --- This change: diff --git a/gcc/function.c b/gcc/function.c index a61e475..3b6718f 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -6238,6 +6238,7 @@ thread_prologue_and_epilogue_insns (void) } /* Now duplicate the tails. */ if (!bitmap_empty_p (&bb_tail)) + { FOR_EACH_BB_REVERSE_FN (bb, cfun) { basic_block copy_bb, tbb; @@ -6304,6 +6305,17 @@ thread_prologue_and_epilogue_insns (void) if (bitmap_empty_p (&bb_tail)) break; } + + /* Basic blocks may have been changed. Merge each basic block + with its successor if possible. */ + FOR_EACH_BB_FN (bb, cfun) + if (single_succ_p (bb)) + { + basic_block succ_bb = single_succ (bb); + if (can_merge_blocks_p (bb, succ_bb)) + merge_blocks (bb, succ_bb); + } + } } fail_shrinkwrap: seems to work.