diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-11-04 18:02:51 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-11-04 18:02:51 +0000 |
commit | ea2d55dfd3520c0372f13446374216055f084e67 (patch) | |
tree | b6f3557754fc7b55112b9e93cb62f67171fbea3b /gcc | |
parent | 9824ce489a3bf43350e9d32067ffb9f1d6243a21 (diff) | |
download | gcc-ea2d55dfd3520c0372f13446374216055f084e67.tar.gz |
2005-11-04 Richard Guenther <rguenther@suse.de>
* tree-flow.h (ref_contains_indirect_ref): Rename to
array_ref_contains_indirect_ref.
* tree-flow-inline.h (ref_contains_indirect_ref): Likewise.
(array_ref_contains_indirect_ref): Make comment match the code
and vice-versa.
(ref_contains_array_ref): Likewise.
* tree-ssa-structalias.c (find_func_aliases): Remove call to
ref_contains_indirect_ref.
* tree-ssa-loop-niter.c (infer_loop_bounds_from_undefined):
Rename calls to ref_contains_indirect_ref.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@106499 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 13 | ||||
-rw-r--r-- | gcc/tree-flow-inline.h | 36 | ||||
-rw-r--r-- | gcc/tree-flow.h | 2 | ||||
-rw-r--r-- | gcc/tree-ssa-loop-niter.c | 6 | ||||
-rw-r--r-- | gcc/tree-ssa-structalias.c | 1 |
5 files changed, 36 insertions, 22 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ed7ad25ceda..5c49c95c073 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,16 @@ +2005-11-04 Richard Guenther <rguenther@suse.de> + + * tree-flow.h (ref_contains_indirect_ref): Rename to + array_ref_contains_indirect_ref. + * tree-flow-inline.h (ref_contains_indirect_ref): Likewise. + (array_ref_contains_indirect_ref): Make comment match the code + and vice-versa. + (ref_contains_array_ref): Likewise. + * tree-ssa-structalias.c (find_func_aliases): Remove call to + ref_contains_indirect_ref. + * tree-ssa-loop-niter.c (infer_loop_bounds_from_undefined): + Rename calls to ref_contains_indirect_ref. + 2005-11-04 Paul Brook <paul@codesourcery.com> * config/arm/arm.c (arm_load_pic_register): Pass extra reg to diff --git a/gcc/tree-flow-inline.h b/gcc/tree-flow-inline.h index d8b57a556af..e31db442a5d 100644 --- a/gcc/tree-flow-inline.h +++ b/gcc/tree-flow-inline.h @@ -1407,32 +1407,34 @@ unmodifiable_var_p (tree var) return TREE_READONLY (var) && (TREE_STATIC (var) || DECL_EXTERNAL (var)); } -/* Return true if REF, an ARRAY_REF, has an INDIRECT_REF somewhere in - it. */ +/* Return true if REF, an ARRAY_REF, has an INDIRECT_REF somewhere in it. */ static inline bool -ref_contains_indirect_ref (tree ref) +array_ref_contains_indirect_ref (tree ref) { - while (handled_component_p (ref)) - { - if (TREE_CODE (ref) == INDIRECT_REF) - return true; - ref = TREE_OPERAND (ref, 0); - } - return false; + gcc_assert (TREE_CODE (ref) == ARRAY_REF); + + do { + ref = TREE_OPERAND (ref, 0); + } while (handled_component_p (ref)); + + return TREE_CODE (ref) == INDIRECT_REF; } -/* Return true if REF, a COMPONENT_REF, has an ARRAY_REF somewhere in it. */ +/* Return true if REF, a handled component reference, has an ARRAY_REF + somewhere in it. */ static inline bool ref_contains_array_ref (tree ref) { - while (handled_component_p (ref)) - { - if (TREE_CODE (ref) == ARRAY_REF) - return true; - ref = TREE_OPERAND (ref, 0); - } + gcc_assert (handled_component_p (ref)); + + do { + if (TREE_CODE (ref) == ARRAY_REF) + return true; + ref = TREE_OPERAND (ref, 0); + } while (handled_component_p (ref)); + return false; } diff --git a/gcc/tree-flow.h b/gcc/tree-flow.h index 135a4e82360..389ec8f94d0 100644 --- a/gcc/tree-flow.h +++ b/gcc/tree-flow.h @@ -614,7 +614,7 @@ extern void count_uses_and_derefs (tree, tree, unsigned *, unsigned *, bool *); static inline subvar_t get_subvars_for_var (tree); static inline tree get_subvar_at (tree, unsigned HOST_WIDE_INT); static inline bool ref_contains_array_ref (tree); -static inline bool ref_contains_indirect_ref (tree); +static inline bool array_ref_contains_indirect_ref (tree); extern tree okay_component_ref_for_subvars (tree, unsigned HOST_WIDE_INT *, unsigned HOST_WIDE_INT *); static inline bool var_can_have_subvars (tree); diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c index 5e35f4efb83..796991bcf50 100644 --- a/gcc/tree-ssa-loop-niter.c +++ b/gcc/tree-ssa-loop-niter.c @@ -1438,11 +1438,11 @@ infer_loop_bounds_from_undefined (struct loop *loop) /* For each array access, analyze its access function and record a bound on the loop iteration domain. */ if (TREE_CODE (op1) == ARRAY_REF - && !ref_contains_indirect_ref (op1)) + && !array_ref_contains_indirect_ref (op1)) estimate_iters_using_array (stmt, op1); if (TREE_CODE (op0) == ARRAY_REF - && !ref_contains_indirect_ref (op0)) + && !array_ref_contains_indirect_ref (op0)) estimate_iters_using_array (stmt, op0); /* For each signed type variable in LOOP, analyze its @@ -1494,7 +1494,7 @@ infer_loop_bounds_from_undefined (struct loop *loop) for (args = TREE_OPERAND (stmt, 1); args; args = TREE_CHAIN (args)) if (TREE_CODE (TREE_VALUE (args)) == ARRAY_REF - && !ref_contains_indirect_ref (TREE_VALUE (args))) + && !array_ref_contains_indirect_ref (TREE_VALUE (args))) estimate_iters_using_array (stmt, TREE_VALUE (args)); break; diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index cee6502ffea..aa912cb7bd0 100644 --- a/gcc/tree-ssa-structalias.c +++ b/gcc/tree-ssa-structalias.c @@ -2865,7 +2865,6 @@ find_func_aliases (tree t, struct alias_info *ai) containing pointers, dereferences, and call expressions. */ if (POINTER_TYPE_P (TREE_TYPE (lhsop)) || AGGREGATE_TYPE_P (TREE_TYPE (lhsop)) - || ref_contains_indirect_ref (lhsop) || TREE_CODE (rhsop) == CALL_EXPR) { lhs = get_constraint_for (lhsop, NULL); |