diff options
author | Sebastian Pop <sebastian.pop@amd.com> | 2009-03-18 16:59:55 +0000 |
---|---|---|
committer | Sebastian Pop <spop@gcc.gnu.org> | 2009-03-18 16:59:55 +0000 |
commit | 9968d233b33186f70cbf9b265ec15b8b97153128 (patch) | |
tree | cb8dceda91b400caad10982f1b60272f8ece3948 /gcc/graphite.c | |
parent | 69484bfd6c661917cb9daafd9082e1b5be3f6ccb (diff) | |
download | gcc-9968d233b33186f70cbf9b265ec15b8b97153128.zip gcc-9968d233b33186f70cbf9b265ec15b8b97153128.tar.gz gcc-9968d233b33186f70cbf9b265ec15b8b97153128.tar.bz2 |
graphite.c (exclude_component_ref): Renamed contains_component_ref_p.
2009-03-18 Sebastian Pop <sebastian.pop@amd.com>
* graphite.c (exclude_component_ref): Renamed contains_component_ref_p.
(is_simple_operand): Call contains_component_ref_p before calling data
reference analysis that would fail on COMPONENT_REFs.
* tree-vrp.c (search_for_addr_array): Fix formatting.
* g++.dg/graphite: New.
* g++.dg/graphite/graphite.exp: New.
* g++.dg/graphite/pr39447.C: New.
From-SVN: r144937
Diffstat (limited to 'gcc/graphite.c')
-rw-r--r-- | gcc/graphite.c | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/gcc/graphite.c b/gcc/graphite.c index 58b67f4..b732b40 100644 --- a/gcc/graphite.c +++ b/gcc/graphite.c @@ -1058,31 +1058,24 @@ 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. */ +/* Return true if REF or any of its subtrees contains a + component_ref. */ static bool -exclude_component_ref (tree op) +contains_component_ref_p (tree ref) { - int i; - int len; + if (!ref) + return false; - if (op) + while (handled_component_p (ref)) { - 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; - } - } + if (TREE_CODE (ref) == COMPONENT_REF) + return true; + + ref = TREE_OPERAND (ref, 0); } - return true; + return false; } /* Return true if the operand OP is simple. */ @@ -1094,13 +1087,15 @@ is_simple_operand (loop_p loop, gimple stmt, tree op) if (DECL_P (op) /* or a structure, */ || AGGREGATE_TYPE_P (TREE_TYPE (op)) + /* or a COMPONENT_REF, */ + || contains_component_ref_p (op) /* or a memory access that cannot be analyzed by the data reference analysis. */ || ((handled_component_p (op) || INDIRECT_REF_P (op)) && !stmt_simple_memref_p (loop, stmt, op))) return false; - return exclude_component_ref (op); + return true; } /* Return true only when STMT is simple enough for being handled by |