diff options
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 |