Message ID | 0aaffa29eefa48e435814390bdeea56107ab2404.1462866472.git.segher@kernel.crashing.org |
---|---|
State | New |
Headers | show |
On 05/10/2016 09:55 AM, Segher Boessenkool wrote: > > PR rtl-optimization/71028 > * cfgcleanup.c (try_optimize_cfg): Do not flip a conditional > jump with just a return in the fallthrough block if the branch > block contains just a returns as well. Looks good. Bernd
diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c index 2463f7c..b3a3989 100644 --- a/gcc/cfgcleanup.c +++ b/gcc/cfgcleanup.c @@ -2875,6 +2875,7 @@ try_optimize_cfg (int mode) a return so that it becomes a conditional return and a new jump to the original branch target. */ if (EDGE_COUNT (b->succs) == 2 + && BRANCH_EDGE (b)->dest != EXIT_BLOCK_PTR_FOR_FN (cfun) && any_condjump_p (BB_END (b)) && bb_is_just_return (FALLTHRU_EDGE (b)->dest, &ret, &use)) {