summaryrefslogtreecommitdiff
path: root/gcc/tree-loop-distribution.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2010-11-09 16:54:05 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2010-11-09 16:54:05 +0000
commit180f0a7eea113ac1fdafee89ac5e497932fc0d44 (patch)
tree753d495c70dbddff79d759e0baeab03d162cb294 /gcc/tree-loop-distribution.c
parent6b71fb7f752aba13d14601d2c29d234c840aa402 (diff)
downloadgcc-180f0a7eea113ac1fdafee89ac5e497932fc0d44.tar.gz
2010-11-09 Richard Guenther <rguenther@suse.de>
PR tree-optimization/46355 * tree-loop-distribution.c (tree_loop_distribution): Do not distribute loops without a single exit. * gcc.dg/pr46355.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@166498 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-loop-distribution.c')
-rw-r--r--gcc/tree-loop-distribution.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/tree-loop-distribution.c b/gcc/tree-loop-distribution.c
index 59585cdd761..007c4f383ec 100644
--- a/gcc/tree-loop-distribution.c
+++ b/gcc/tree-loop-distribution.c
@@ -1145,7 +1145,12 @@ tree_loop_distribution (void)
FOR_EACH_LOOP (li, loop, 0)
{
- VEC (gimple, heap) *work_list = VEC_alloc (gimple, heap, 3);
+ VEC (gimple, heap) *work_list = NULL;
+
+ /* If the loop doesn't have a single exit we will fail anyway,
+ so do that early. */
+ if (!single_exit (loop))
+ continue;
/* If both flag_tree_loop_distribute_patterns and
flag_tree_loop_distribution are set, then only