aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJ"orn Rennecke <amylaar@cygnus.co.uk>1998-08-28 07:05:20 +0000
committerJoern Rennecke <amylaar@gcc.gnu.org>1998-08-28 08:05:20 +0100
commit8ed69d0908630adcf3d385266d168f49d3ba1b5e (patch)
tree6c6aff5933114d7bb65a9a3e4bcc32b2e46dc44d /gcc
parentaf3d5d5313883181d26f30e9397470c3ee144b53 (diff)
downloadgcc-8ed69d0908630adcf3d385266d168f49d3ba1b5e.zip
gcc-8ed69d0908630adcf3d385266d168f49d3ba1b5e.tar.gz
gcc-8ed69d0908630adcf3d385266d168f49d3ba1b5e.tar.bz2
loop.c (check_dbra_loop): Fix calculation of FINAL_VALUE when COMPARISON_VAL was normalized.
* loop.c (check_dbra_loop): Fix calculation of FINAL_VALUE when COMPARISON_VAL was normalized. From-SVN: r22051
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/loop.c12
2 files changed, 14 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ae5ef3d..9341194 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+Fri Aug 28 14:54:07 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
+
+ * loop.c (check_dbra_loop): Fix calculation of FINAL_VALUE when
+ COMPARISON_VAL was normalized.
+
Thu Aug 27 20:10:46 1998 Jeffrey A Law (law@cygnus.com)
* loop.c (check_dbra_loop): The loop ending comparison value
diff --git a/gcc/loop.c b/gcc/loop.c
index cd257be..e581f44 100644
--- a/gcc/loop.c
+++ b/gcc/loop.c
@@ -7004,11 +7004,18 @@ check_dbra_loop (loop_end, insn_count, loop_start)
return 0;
}
+ final_value = comparison_value;
+
/* Reset these in case we normalized the initial value
and comparison value above. */
+ if (GET_CODE (comparison_value) == CONST_INT
+ && GET_CODE (initial_value) == CONST_INT)
+ {
+ comparison_value = GEN_INT (comparison_val);
+ final_value
+ = GEN_INT (comparison_val + INTVAL (bl->initial_value));
+ }
bl->initial_value = initial_value;
- if (GET_CODE (comparison_value) == CONST_INT)
- comparison_value = GEN_INT (comparison_val);
/* Save some info needed to produce the new insns. */
reg = bl->biv->dest_reg;
@@ -7017,7 +7024,6 @@ check_dbra_loop (loop_end, insn_count, loop_start)
jump_label = XEXP (SET_SRC (PATTERN (PREV_INSN (loop_end))), 2);
new_add_val = GEN_INT (- INTVAL (bl->biv->add_val));
- final_value = comparison_value;
/* Set start_value; if this is not a CONST_INT, we need
to generate a SUB.
Initialize biv to start_value before loop start.