Commit 7eeef08e by Richard Guenther Committed by Richard Biener

tree-ssa-loop-ivopts.c (add_iv_value_candidates): Also add the candidate with…

tree-ssa-loop-ivopts.c (add_iv_value_candidates): Also add the candidate with the stripped base if...

2008-08-04  Richard Guenther  <rguenther@suse.de>

	* tree-ssa-loop-ivopts.c (add_iv_value_candidates): Also add
	the candidate with the stripped base if that base is different
	from the original base even for offset zero.

From-SVN: r138647
parent 8f45dcf8
2008-08-04 Richard Guenther <rguenther@suse.de>
* tree-ssa-loop-ivopts.c (add_iv_value_candidates): Also add
the candidate with the stripped base if that base is different
from the original base even for offset zero.
2008-08-04 Richard Guenther <rguenther@suse.de>
PR middle-end/36691
* tree-ssa-loop-niter.c (number_of_iterations_lt_to_ne): Correctly
check for no_overflow.
......
......@@ -2275,9 +2275,11 @@ add_iv_value_candidates (struct ivopts_data *data,
add_candidate (data, build_int_cst (basetype, 0),
iv->step, true, use);
/* Third, try removing the constant offset. */
/* Third, try removing the constant offset. Make sure to even
add a candidate for &a[0] vs. (T *)&a. */
base = strip_offset (iv->base, &offset);
if (offset)
if (offset
|| base != iv->base)
add_candidate (data, base, iv->step, false, use);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment