aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-data-ref.c
diff options
context:
space:
mode:
authorZdenek Dvorak <dvorakz@suse.cz>2007-04-07 01:11:15 +0200
committerZdenek Dvorak <rakdver@gcc.gnu.org>2007-04-06 23:11:15 +0000
commitac84e05eb6a3cc6f2da0816537b5cbd5a5d58f1b (patch)
tree6e9884d45709a7814b362ea6e6dbf57ecb1ab63e /gcc/tree-data-ref.c
parent64199a9eedbd34833b7712d6da13d117fa3ef9f4 (diff)
downloadgcc-ac84e05eb6a3cc6f2da0816537b5cbd5a5d58f1b.zip
gcc-ac84e05eb6a3cc6f2da0816537b5cbd5a5d58f1b.tar.gz
gcc-ac84e05eb6a3cc6f2da0816537b5cbd5a5d58f1b.tar.bz2
tree-ssa-loop-niter.c (idx_infer_loop_bounds): Add and use argument "reliable".
* tree-ssa-loop-niter.c (idx_infer_loop_bounds): Add and use argument "reliable". (infer_loop_bounds_from_ref, infer_loop_bounds_from_array): Add argument "reliable". Propagate it through calls. (infer_loop_bounds_from_undefined): Derive number of iterations estimates from references in blocks that do not dominate loop latch. (gcov_type_to_double_int): New function. (estimate_numbers_of_iterations_loop): Use gcov_type_to_double_int and expected_loop_iterations_unbounded. * cfgloopanal.c (expected_loop_iterations_unbounded): New function. (expected_loop_iterations): Use expected_loop_iterations_unbounded. * tree-data-ref.c (estimated_loop_iterations): Export. (get_references_in_stmt): Fix -- do not return addresses of local objects. * cfgloop.h (expected_loop_iterations_unbounded, estimated_loop_iterations): Declare. From-SVN: r123630
Diffstat (limited to 'gcc/tree-data-ref.c')
-rw-r--r--gcc/tree-data-ref.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/gcc/tree-data-ref.c b/gcc/tree-data-ref.c
index d8a291d..3f24c6a 100644
--- a/gcc/tree-data-ref.c
+++ b/gcc/tree-data-ref.c
@@ -2553,7 +2553,7 @@ analyze_ziv_subscript (tree chrec_a,
large as the number of iterations. If we have no reliable estimate,
the function returns false, otherwise returns true. */
-static bool
+bool
estimated_loop_iterations (struct loop *loop, bool conservative,
double_int *nit)
{
@@ -4873,8 +4873,7 @@ get_references_in_stmt (tree stmt, VEC (data_ref_loc, heap) **references)
{
bool clobbers_memory = false;
data_ref_loc *ref;
- tree *op0, *op1, arg, call;
- call_expr_arg_iterator iter;
+ tree *op0, *op1, call;
*references = NULL;
@@ -4915,9 +4914,12 @@ get_references_in_stmt (tree stmt, VEC (data_ref_loc, heap) **references)
if (call)
{
- FOR_EACH_CALL_EXPR_ARG (arg, iter, call)
+ unsigned i, n = call_expr_nargs (call);
+
+ for (i = 0; i < n; i++)
{
- op0 = &arg;
+ op0 = &CALL_EXPR_ARG (call, i);
+
if (DECL_P (*op0)
|| REFERENCE_CLASS_P (*op0))
{