aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2012-10-20 16:19:12 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2012-10-20 14:19:12 +0000
commitbcd8d322db3a07471bd32ceeefbd0c5145a934ca (patch)
tree0567eba9d46edbae6337e20803e32610525d1bfe /gcc
parent4a0ae68e1ce9e7fb876b9846bee6a77d9c592e52 (diff)
downloadgcc-bcd8d322db3a07471bd32ceeefbd0c5145a934ca.zip
gcc-bcd8d322db3a07471bd32ceeefbd0c5145a934ca.tar.gz
gcc-bcd8d322db3a07471bd32ceeefbd0c5145a934ca.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/loop-iv.c18
2 files changed, 17 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ecba9c6..47263fd 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+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>
PR c/53063
diff --git a/gcc/loop-iv.c b/gcc/loop-iv.c
index 43d3c4e..50b7536 100644
--- a/gcc/loop-iv.c
+++ b/gcc/loop-iv.c
@@ -2593,8 +2593,10 @@ iv_number_of_iterations (struct loop *loop, rtx insn, rtx condition,
? iv0.base
: mode_mmin);
max = (up - down) / inc + 1;
- record_niter_bound (loop, double_int::from_uhwi (max),
- false, true);
+ if (!desc->infinite
+ && !desc->assumptions)
+ record_niter_bound (loop, double_int::from_uhwi (max),
+ false, true);
if (iv0.step == const0_rtx)
{
@@ -2806,15 +2808,19 @@ iv_number_of_iterations (struct loop *loop, rtx insn, rtx condition,
desc->const_iter = true;
desc->niter = val & GET_MODE_MASK (desc->mode);
- record_niter_bound (loop, double_int::from_uhwi (desc->niter),
- false, true);
+ if (!desc->infinite
+ && !desc->assumptions)
+ record_niter_bound (loop, double_int::from_uhwi (desc->niter),
+ false, true);
}
else
{
max = determine_max_iter (loop, desc, old_niter);
gcc_assert (max);
- record_niter_bound (loop, double_int::from_uhwi (max),
- false, true);
+ if (!desc->infinite
+ && !desc->assumptions)
+ record_niter_bound (loop, double_int::from_uhwi (max),
+ false, true);
/* simplify_using_initial_values does a copy propagation on the registers
in the expression for the number of iterations. This prolongs life