diff options
author | spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-11-03 16:43:02 +0000 |
---|---|---|
committer | spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-11-03 16:43:02 +0000 |
commit | bbbd581ff7c71b26e7830c402e6a7e70ffb73742 (patch) | |
tree | 440c21c8ac130fa7e70f68cf8d3d71d50fd7e22b /gcc/graphite.c | |
parent | 577982d87ba0f4f257fc25479992e1ada6d6fbc1 (diff) | |
download | gcc-bbbd581ff7c71b26e7830c402e6a7e70ffb73742.tar.gz |
2008-11-03 Harsha Jagasia <harsha.jagasia@amd.com>
PR tree-optimization/37684
* gcc.dg/graphite/pr37684.c: New.
* graphite.c (exclude_component_ref): New.
(is_simple_operand): Call exclude_component_ref.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@141551 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/graphite.c')
-rw-r--r-- | gcc/graphite.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/gcc/graphite.c b/gcc/graphite.c index a14dd141e3e..90d82301202 100644 --- a/gcc/graphite.c +++ b/gcc/graphite.c @@ -864,6 +864,33 @@ loop_affine_expr (basic_block scop_entry, struct loop *loop, tree expr) || evolution_function_is_affine_multivariate_p (scev, n)); } +/* Return false if the tree_code of the operand OP or any of its operands + is component_ref. */ + +static bool +exclude_component_ref (tree op) +{ + int i; + int len; + + if (op) + { + if (TREE_CODE (op) == COMPONENT_REF) + return false; + else + { + len = TREE_OPERAND_LENGTH (op); + for (i = 0; i < len; ++i) + { + if (!exclude_component_ref (TREE_OPERAND (op, i))) + return false; + } + } + } + + return true; +} + /* Return true if the operand OP is simple. */ static bool @@ -879,7 +906,7 @@ is_simple_operand (loop_p loop, gimple stmt, tree op) && !stmt_simple_memref_p (loop, stmt, op))) return false; - return true; + return exclude_component_ref (op); } /* Return true only when STMT is simple enough for being handled by |