aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-loop.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2015-12-10 09:00:58 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2015-12-10 09:00:58 +0000
commit77ad31753c0440c4141e957edee243f739570587 (patch)
tree5328b717f19d7bac98d91a9f176e50a68f597d1b /gcc/tree-vect-loop.c
parenta839a8f708dcd6087e3cf3cdfbbaf879f549e1ab (diff)
downloadgcc-77ad31753c0440c4141e957edee243f739570587.zip
gcc-77ad31753c0440c4141e957edee243f739570587.tar.gz
gcc-77ad31753c0440c4141e957edee243f739570587.tar.bz2
re PR tree-optimization/68806 (internal compiler error: Segmentation fault)
2015-12-10 Richard Biener <rguenther@suse.de> PR tree-optimization/68806 * tree-vect-loop.c (vect_analyze_loop_2): Properly detect reduction chains and ignore SLP reductions. * gcc.dg/torture/pr68806.c: New testcase. From-SVN: r231493
Diffstat (limited to 'gcc/tree-vect-loop.c')
-rw-r--r--gcc/tree-vect-loop.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index ee32166..77ad760 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -2123,9 +2123,12 @@ again:
if (!slp)
return false;
+ /* If there are reduction chains re-trying will fail anyway. */
+ if (! LOOP_VINFO_REDUCTION_CHAINS (loop_vinfo).is_empty ())
+ return false;
+
/* Likewise if the grouped loads or stores in the SLP cannot be handled
- via interleaving or lane instructions or if there were any SLP
- reductions. */
+ via interleaving or lane instructions. */
slp_instance instance;
slp_tree node;
unsigned i, j;
@@ -2135,7 +2138,7 @@ again:
vinfo = vinfo_for_stmt
(SLP_TREE_SCALAR_STMTS (SLP_INSTANCE_TREE (instance))[0]);
if (! STMT_VINFO_GROUPED_ACCESS (vinfo))
- return false;
+ continue;
vinfo = vinfo_for_stmt (STMT_VINFO_GROUP_FIRST_ELEMENT (vinfo));
unsigned int size = STMT_VINFO_GROUP_SIZE (vinfo);
tree vectype = STMT_VINFO_VECTYPE (vinfo);