|| 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. */
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