diff options
author | J"orn Rennecke <amylaar@cygnus.co.uk> | 2000-05-25 01:30:51 +0000 |
---|---|---|
committer | Joern Rennecke <amylaar@gcc.gnu.org> | 2000-05-25 02:30:51 +0100 |
commit | af1980974939d286cf7d8341a902c0824a52ad0e (patch) | |
tree | 23deba3bdcf72e5708b166a15f5e267fa74780b2 /gcc | |
parent | 73bb94549e0777fbd981ad68745efa6c0715f0c5 (diff) | |
download | gcc-af1980974939d286cf7d8341a902c0824a52ad0e.zip gcc-af1980974939d286cf7d8341a902c0824a52ad0e.tar.gz gcc-af1980974939d286cf7d8341a902c0824a52ad0e.tar.bz2 |
* loop.c (basic_induction_var): Avoid double recording of an increment.
From-SVN: r34153
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/loop.c | 8 |
2 files changed, 11 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ded3ed74..5f2ac8d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +Thu May 25 02:27:22 2000 J"orn Rennecke <amylaar@cygnus.co.uk> + + * loop.c (basic_induction_var): Avoid double recording of an increment. + Thu May 25 02:19:27 2000 J"orn Rennecke <amylaar@cygnus.co.uk> * Back out this patch: @@ -5995,6 +5995,11 @@ basic_induction_var (loop, x, mode, dest_reg, p, inc_val, mult_val, location) /* If this register is assigned in a previous insn, look at its source, but don't go outside the loop or past a label. */ + /* If this sets a register to itself, we would repeat any previous + biv increment if we applied this strategy blindly. */ + if (rtx_equal_p (dest_reg, x)) + return 0; + insn = p; while (1) { @@ -6066,7 +6071,8 @@ basic_induction_var (loop, x, mode, dest_reg, p, inc_val, mult_val, location) if (insn) set = single_set (insn); - if (set && SET_DEST (set) == XEXP (x, 0) + if (! rtx_equal_p (dest_reg, XEXP (x, 0)) + && set && SET_DEST (set) == XEXP (x, 0) && GET_CODE (XEXP (x, 1)) == CONST_INT && INTVAL (XEXP (x, 1)) >= 0 && GET_CODE (SET_SRC (set)) == ASHIFT |