summaryrefslogtreecommitdiff
path: root/gcc/graphite-scop-detection.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2014-04-14 08:09:06 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2014-04-14 08:09:06 +0000
commit98acb419f002937108fe95d95fb87b655bc7efd6 (patch)
treed7e6bcc55f059e8078a20e844d75b2e20e91d772 /gcc/graphite-scop-detection.c
parent5b069d81349aebc8cbaf17098b740333554cf7c6 (diff)
downloadgcc-98acb419f002937108fe95d95fb87b655bc7efd6.tar.gz
2014-04-14 Richard Biener <rguenther@suse.de>
PR tree-optimization/59817 PR tree-optimization/60453 * graphite-scop-detection.c (graphite_can_represent_scev): Complete recursion to catch all CHRECs in the scalar evolution and restrict the predicate for the remains appropriately. * gfortran.dg/graphite/pr59817.f: New testcase. * gcc.dg/graphite/pr59817-1.c: Likewise. * gcc.dg/graphite/pr59817-2.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@209355 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/graphite-scop-detection.c')
-rw-r--r--gcc/graphite-scop-detection.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/gcc/graphite-scop-detection.c b/gcc/graphite-scop-detection.c
index b5e4a8c8cb3..821f0846ef2 100644
--- a/gcc/graphite-scop-detection.c
+++ b/gcc/graphite-scop-detection.c
@@ -219,7 +219,14 @@ graphite_can_represent_scev (tree scev)
switch (TREE_CODE (scev))
{
+ case NEGATE_EXPR:
+ case BIT_NOT_EXPR:
+ CASE_CONVERT:
+ case NON_LVALUE_EXPR:
+ return graphite_can_represent_scev (TREE_OPERAND (scev, 0));
+
case PLUS_EXPR:
+ case POINTER_PLUS_EXPR:
case MINUS_EXPR:
return graphite_can_represent_scev (TREE_OPERAND (scev, 0))
&& graphite_can_represent_scev (TREE_OPERAND (scev, 1));
@@ -241,13 +248,15 @@ graphite_can_represent_scev (tree scev)
if (!evolution_function_right_is_integer_cst (scev)
|| !graphite_can_represent_init (scev))
return false;
+ return graphite_can_represent_scev (CHREC_LEFT (scev));
default:
break;
}
/* Only affine functions can be represented. */
- if (!scev_is_linear_expression (scev))
+ if (tree_contains_chrecs (scev, NULL)
+ || !scev_is_linear_expression (scev))
return false;
return true;