summaryrefslogtreecommitdiff
path: root/gcc/tree-predcom.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2015-02-18 13:08:58 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2015-02-18 13:08:58 +0000
commit67a97bd851515ff1b62b80ee3ad571163209e72b (patch)
tree3777ceaf738435971495c600f1c05fc340338271 /gcc/tree-predcom.c
parent9b8af749304e1b1d8460a79fbbefc07b642e2616 (diff)
downloadgcc-67a97bd851515ff1b62b80ee3ad571163209e72b.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@220788 138bc75d-0d04-0410-961f-82ee72b054a4
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;