Commit bcd8d322 by Jan Hubicka Committed by Jan Hubicka

loop-iv.c (iv_number_of_iterations): Record the upper bound only if there are no…

loop-iv.c (iv_number_of_iterations): Record the upper bound only if there are no further conditions on it.


	* loop-iv.c (iv_number_of_iterations): Record the upper bound
	only if there are no further conditions on it.

From-SVN: r192636
parent 4a0ae68e
2012-10-20 Jan Hubicka <jh@suse.cz>
* loop-iv.c (iv_number_of_iterations): Record the upper bound
only if there are no further conditions on it.
2012-10-20 Manuel López-Ibáñez <manu@gcc.gnu.org> 2012-10-20 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c/53063 PR c/53063
...@@ -2593,6 +2593,8 @@ iv_number_of_iterations (struct loop *loop, rtx insn, rtx condition, ...@@ -2593,6 +2593,8 @@ iv_number_of_iterations (struct loop *loop, rtx insn, rtx condition,
? iv0.base ? iv0.base
: mode_mmin); : mode_mmin);
max = (up - down) / inc + 1; max = (up - down) / inc + 1;
if (!desc->infinite
&& !desc->assumptions)
record_niter_bound (loop, double_int::from_uhwi (max), record_niter_bound (loop, double_int::from_uhwi (max),
false, true); false, true);
...@@ -2806,6 +2808,8 @@ iv_number_of_iterations (struct loop *loop, rtx insn, rtx condition, ...@@ -2806,6 +2808,8 @@ iv_number_of_iterations (struct loop *loop, rtx insn, rtx condition,
desc->const_iter = true; desc->const_iter = true;
desc->niter = val & GET_MODE_MASK (desc->mode); desc->niter = val & GET_MODE_MASK (desc->mode);
if (!desc->infinite
&& !desc->assumptions)
record_niter_bound (loop, double_int::from_uhwi (desc->niter), record_niter_bound (loop, double_int::from_uhwi (desc->niter),
false, true); false, true);
} }
...@@ -2813,6 +2817,8 @@ iv_number_of_iterations (struct loop *loop, rtx insn, rtx condition, ...@@ -2813,6 +2817,8 @@ iv_number_of_iterations (struct loop *loop, rtx insn, rtx condition,
{ {
max = determine_max_iter (loop, desc, old_niter); max = determine_max_iter (loop, desc, old_niter);
gcc_assert (max); gcc_assert (max);
if (!desc->infinite
&& !desc->assumptions)
record_niter_bound (loop, double_int::from_uhwi (max), record_niter_bound (loop, double_int::from_uhwi (max),
false, true); false, true);
......
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