summaryrefslogtreecommitdiff
path: root/gcc/graphite.c
diff options
context:
space:
mode:
authorspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>2009-03-18 16:59:55 +0000
committerspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>2009-03-18 16:59:55 +0000
commit8fa85fc5e4c9e98608d5a0d8281b8f8b75ac7096 (patch)
treecb8dceda91b400caad10982f1b60272f8ece3948 /gcc/graphite.c
parenta39f4102732a5b61a981db4f396462b1256184f4 (diff)
downloadgcc-8fa85fc5e4c9e98608d5a0d8281b8f8b75ac7096.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@144937 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/graphite.c')
-rw-r--r--gcc/graphite.c33
1 files changed, 14 insertions, 19 deletions
diff --git a/gcc/graphite.c b/gcc/graphite.c
index 58b67f4255a..b732b40d214 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