summaryrefslogtreecommitdiff
path: root/gcc/tree-predcom.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2015-02-18 13:08:58 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2015-02-18 13:08:58 +0000
commit8039a35df1ddf6a7ff4a77396f283547c145aa84 (patch)
tree3777ceaf738435971495c600f1c05fc340338271 /gcc/tree-predcom.c
parent0c28944fc0afabc39bf675723e2021e306973624 (diff)
re PR tree-optimization/65063 (gcc.dg/vect/vect-double-reduc-6.c FAILs with -O3 -fno-tree-loop-ivcanon -fno-tree-vectorize)
2015-02-18 Richard Biener <rguenther@suse.de> PR tree-optimization/65063 * tree-predcom.c (determine_unroll_factor): Return 1 if we have replaced looparound PHIs. * gcc.dg/pr65063.c: New testcase. From-SVN: r220788
Diffstat (limited to 'gcc/tree-predcom.c')
-rw-r--r--gcc/tree-predcom.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/gcc/tree-predcom.c b/gcc/tree-predcom.c
index 8dac1ba5afd..03a38b4de84 100644
--- a/gcc/tree-predcom.c
+++ b/gcc/tree-predcom.c
@@ -1775,9 +1775,21 @@ determine_unroll_factor (vec<chain_p> chains)
FOR_EACH_VEC_ELT (chains, i, chain)
{
- if (chain->type == CT_INVARIANT || chain->combined)
+ if (chain->type == CT_INVARIANT)
continue;
+ if (chain->combined)
+ {
+ /* For combined chains, we can't handle unrolling if we replace
+ looparound PHIs. */
+ dref a;
+ unsigned j;
+ for (j = 1; chain->refs.iterate (j, &a); j++)
+ if (gimple_code (a->stmt) == GIMPLE_PHI)
+ return 1;
+ continue;
+ }
+
/* The best unroll factor for this chain is equal to the number of
temporary variables that we create for it. */
af = chain->length;