summaryrefslogtreecommitdiffstats
path: root/gcc/tree-ssa-loop-niter.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2012-04-17 13:33:41 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2012-04-17 13:33:41 +0000
commite01d3bb3abd2029e1e4fbfb4e2ce6cfc0a63ca97 (patch)
tree6270e0e0ea62af5d1c4e2f324991ab27ce6e48b0 /gcc/tree-ssa-loop-niter.c
parent1c391fd0211847948e9903ed2de7b7b7950b8ea6 (diff)
downloadppe42-gcc-e01d3bb3abd2029e1e4fbfb4e2ce6cfc0a63ca97.tar.gz
ppe42-gcc-e01d3bb3abd2029e1e4fbfb4e2ce6cfc0a63ca97.zip
2012-04-17 Richard Guenther <rguenther@suse.de>
* tree-flow.h (array_at_struct_end_p): Move declaration ... * tree.h (array_at_struct_end_p): ... here. * tree-ssa-loop-niter.c (array_at_struct_end_p): Move ... * expr.c (array_at_struct_end_p): ... here. Rewrite. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186527 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-loop-niter.c')
-rw-r--r--gcc/tree-ssa-loop-niter.c41
1 files changed, 0 insertions, 41 deletions
diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c
index 2529b367300..82251219665 100644
--- a/gcc/tree-ssa-loop-niter.c
+++ b/gcc/tree-ssa-loop-niter.c
@@ -2640,47 +2640,6 @@ record_nonwrapping_iv (struct loop *loop, tree base, tree step, gimple stmt,
record_estimate (loop, niter_bound, max, stmt, false, realistic, upper);
}
-/* Returns true if REF is a reference to an array at the end of a dynamically
- allocated structure. If this is the case, the array may be allocated larger
- than its upper bound implies. */
-
-bool
-array_at_struct_end_p (tree ref)
-{
- tree base = get_base_address (ref);
- tree parent, field;
-
- /* Unless the reference is through a pointer, the size of the array matches
- its declaration. */
- if (!base || (!INDIRECT_REF_P (base) && TREE_CODE (base) != MEM_REF))
- return false;
-
- for (;handled_component_p (ref); ref = parent)
- {
- parent = TREE_OPERAND (ref, 0);
-
- if (TREE_CODE (ref) == COMPONENT_REF)
- {
- /* All fields of a union are at its end. */
- if (TREE_CODE (TREE_TYPE (parent)) == UNION_TYPE)
- continue;
-
- /* Unless the field is at the end of the struct, we are done. */
- field = TREE_OPERAND (ref, 1);
- if (DECL_CHAIN (field))
- return false;
- }
-
- /* The other options are ARRAY_REF, ARRAY_RANGE_REF, VIEW_CONVERT_EXPR.
- In all these cases, we might be accessing the last element, and
- although in practice this will probably never happen, it is legal for
- the indices of this last element to exceed the bounds of the array.
- Therefore, continue checking. */
- }
-
- return true;
-}
-
/* Determine information about number of iterations a LOOP from the index
IDX of a data reference accessed in STMT. RELIABLE is true if STMT is
guaranteed to be executed in every iteration of LOOP. Callback for
OpenPOWER on IntegriCloud