summaryrefslogtreecommitdiff
path: root/gcc/unroll.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2002-06-15 01:10:49 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2002-06-15 01:10:49 +0000
commita22e3dfa0b89b630518417da71e5060580f7c6cd (patch)
tree32973a77f9b92a29a421bc6e7eefe35737b606cc /gcc/unroll.c
parentfa81344030faf9d4f501a535dac42d6fdb58000a (diff)
downloadgcc-a22e3dfa0b89b630518417da71e5060580f7c6cd.tar.gz
* loop.c (check_final_value): Use v->always_executed
instead of v->always_computable. * unroll.c (final_giv_value): Don't calculate the final value as a function of the biv if the giv is not computed for every loop iteration. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@54634 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/unroll.c')
-rw-r--r--gcc/unroll.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/unroll.c b/gcc/unroll.c
index 3b81d223ac7..a795dcbc202 100644
--- a/gcc/unroll.c
+++ b/gcc/unroll.c
@@ -3249,7 +3249,8 @@ final_giv_value (loop, v)
/* Try to calculate the final value as a function of the biv it depends
upon. The only exit from the loop must be the fall through at the bottom
- (otherwise it may not have its final value when the loop exits). */
+ and the insn that sets the giv must be executed on every iteration
+ (otherwise the giv may not have its final value when the loop exits). */
/* ??? Can calculate the final giv value by subtracting off the
extra biv increments times the giv's mult_val. The loop must have
@@ -3257,7 +3258,8 @@ final_giv_value (loop, v)
to be known. */
if (n_iterations != 0
- && ! loop->exit_count)
+ && ! loop->exit_count
+ && v->always_executed)
{
/* ?? It is tempting to use the biv's value here since these insns will
be put after the loop, and hence the biv will have its final value