diff options
author | Jeff Law <law@redhat.com> | 2016-10-06 10:23:22 -0600 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 2016-10-06 10:23:22 -0600 |
commit | f31276858a7182663abc0f91fd8961231191b9ed (patch) | |
tree | e725aca2c8be545345030d9cb58244de3718c495 /gcc/tree-cfgcleanup.c | |
parent | 63656b8da287658256ad6d6883b9da1b0f59e900 (diff) | |
download | gcc-f31276858a7182663abc0f91fd8961231191b9ed.zip gcc-f31276858a7182663abc0f91fd8961231191b9ed.tar.gz gcc-f31276858a7182663abc0f91fd8961231191b9ed.tar.bz2 |
re PR tree-optimization/71661 (wrong code at -O3)
PR tree-optimization/71661
* tree-cfgcleanup.c (remove_forwarder_block_with_phi): Handle case when
removal of a forwarder exposes a new natural loop.
PR tree-optimization/71661
* gcc.dg/tree-ssa/pr71661.c: New test.
From-SVN: r240836
Diffstat (limited to 'gcc/tree-cfgcleanup.c')
-rw-r--r-- | gcc/tree-cfgcleanup.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/tree-cfgcleanup.c b/gcc/tree-cfgcleanup.c index 6052872..21873f8 100644 --- a/gcc/tree-cfgcleanup.c +++ b/gcc/tree-cfgcleanup.c @@ -840,6 +840,11 @@ remove_forwarder_block_with_phi (basic_block bb) if (dest == bb) return false; + /* Removal of forwarders may expose new natural loops and thus + a block may turn into a loop header. */ + if (current_loops && bb_loop_header_p (bb)) + return false; + /* If the destination block consists of a nonlocal label, do not merge it. */ label = first_stmt (dest); |