summaryrefslogtreecommitdiff
path: root/gcc/tree-flow-inline.h
diff options
context:
space:
mode:
authordberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4>2005-09-22 00:42:28 +0000
committerdberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4>2005-09-22 00:42:28 +0000
commitd0186307062d00b77b83f0fb907604943f3493cc (patch)
tree4b807050400db7408a16243b129aa442be14c1d6 /gcc/tree-flow-inline.h
parentc0790887e53a275fa58f4fbf438d81dc73a6130c (diff)
downloadgcc-d0186307062d00b77b83f0fb907604943f3493cc.tar.gz
2005-09-20 Daniel Berlin <dberlin@dberlin.org>
* tree-data-ref.c (analyze_array_indexes): Only estimate when estimate_only is true. * tree-flow.h (ref_contains_indirect_ref): New prototype. * tree-flow-inline.h (ref_contains_indirect_ref): Moved from tree-ssa-structalias.c * tree-ssa-loop-niter.c (infer_loop_bounds_from_undefined): Use ref_contains_indirect_ref. * tree-ssa-structalias.c (ref_contains_indirect_ref): Moved. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@104518 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-flow-inline.h')
-rw-r--r--gcc/tree-flow-inline.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/tree-flow-inline.h b/gcc/tree-flow-inline.h
index b0f5e888551..b317c8ccc9a 100644
--- a/gcc/tree-flow-inline.h
+++ b/gcc/tree-flow-inline.h
@@ -1414,6 +1414,21 @@ 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. */
+
+static inline bool
+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;
+}
+
/* Return true if REF, a COMPONENT_REF, has an ARRAY_REF somewhere in it. */
static inline bool