aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-cfg.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2015-01-12 15:34:37 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2015-01-12 15:34:37 +0000
commit2a58c80212892d88e199e6ab154404b80fdbd298 (patch)
tree543e2a2d4fb5601fbfcf000ce3d6c5aa8b2c81ba /gcc/tree-cfg.c
parent82ac9e41644a4673f5f592f4596b2e89ea181794 (diff)
downloadgcc-2a58c80212892d88e199e6ab154404b80fdbd298.zip
gcc-2a58c80212892d88e199e6ab154404b80fdbd298.tar.gz
gcc-2a58c80212892d88e199e6ab154404b80fdbd298.tar.bz2
re PR tree-optimization/64357 (ICE at -Os on x86_64-linux-gnu in check_loop_closed_ssa_use, at tree-ssa-loop-manip.c:579)
2015-01-12 Richard Biener <rguenther@suse.de> PR middle-end/64357 * tree-cfg.c (gimple_can_merge_blocks_p): Protect simple latches properly. * gcc.dg/torture/pr64357.c: New testcase. From-SVN: r219473
Diffstat (limited to 'gcc/tree-cfg.c')
-rw-r--r--gcc/tree-cfg.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index a9a2c2f..38e5e7d 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -1723,11 +1723,13 @@ gimple_can_merge_blocks_p (basic_block a, basic_block b)
}
/* Protect simple loop latches. We only want to avoid merging
- the latch with the loop header in this case. */
+ the latch with the loop header or with a block in another
+ loop in this case. */
if (current_loops
&& b->loop_father->latch == b
&& loops_state_satisfies_p (LOOPS_HAVE_SIMPLE_LATCHES)
- && b->loop_father->header == a)
+ && (b->loop_father->header == a
+ || b->loop_father != a->loop_father))
return false;
/* It must be possible to eliminate all phi nodes in B. If ssa form