aboutsummaryrefslogtreecommitdiff
path: root/gcc/loop.c
diff options
context:
space:
mode:
authorBernd Schmidt <bernds@redhat.co.uk>2000-11-27 14:42:54 +0000
committerBernd Schmidt <bernds@gcc.gnu.org>2000-11-27 14:42:54 +0000
commit7dbe6ae9b3232d6ff940ef8c6a65381e291154cd (patch)
tree6d154dfc6c0730c4f7ae41a405ed947c335379a8 /gcc/loop.c
parent76e57b458976f18172c6e0ac1cffea3e6b6a1e24 (diff)
downloadgcc-7dbe6ae9b3232d6ff940ef8c6a65381e291154cd.zip
gcc-7dbe6ae9b3232d6ff940ef8c6a65381e291154cd.tar.gz
gcc-7dbe6ae9b3232d6ff940ef8c6a65381e291154cd.tar.bz2
Re-apply an earlier fix, with a small update
From-SVN: r37794
Diffstat (limited to 'gcc/loop.c')
-rw-r--r--gcc/loop.c36
1 files changed, 21 insertions, 15 deletions
diff --git a/gcc/loop.c b/gcc/loop.c
index a514d05..7b4fd31 100644
--- a/gcc/loop.c
+++ b/gcc/loop.c
@@ -5467,6 +5467,7 @@ basic_induction_var (loop, x, mode, dest_reg, p, inc_val, mult_val, location)
insn = p;
while (1)
{
+ rtx dest;
do
{
insn = PREV_INSN (insn);
@@ -5479,21 +5480,26 @@ basic_induction_var (loop, x, mode, dest_reg, p, inc_val, mult_val, location)
set = single_set (insn);
if (set == 0)
break;
-
- if ((SET_DEST (set) == x
- || (GET_CODE (SET_DEST (set)) == SUBREG
- && (GET_MODE_SIZE (GET_MODE (SET_DEST (set)))
- <= UNITS_PER_WORD)
- && (GET_MODE_CLASS (GET_MODE (SET_DEST (set)))
- == MODE_INT)
- && SUBREG_REG (SET_DEST (set)) == x))
- && basic_induction_var (loop, SET_SRC (set),
- (GET_MODE (SET_SRC (set)) == VOIDmode
- ? GET_MODE (x)
- : GET_MODE (SET_SRC (set))),
- dest_reg, insn,
- inc_val, mult_val, location))
- return 1;
+ dest = SET_DEST (set);
+ if (dest == x
+ || (GET_CODE (dest) == SUBREG
+ && (GET_MODE_SIZE (GET_MODE (dest)) <= UNITS_PER_WORD)
+ && (GET_MODE_CLASS (GET_MODE (dest)) == MODE_INT)
+ && SUBREG_REG (dest) == x))
+ return basic_induction_var (loop, SET_SRC (set),
+ (GET_MODE (SET_SRC (set)) == VOIDmode
+ ? GET_MODE (x)
+ : GET_MODE (SET_SRC (set))),
+ dest_reg, insn,
+ inc_val, mult_val, location);
+
+ while (GET_CODE (dest) == SIGN_EXTRACT
+ || GET_CODE (dest) == ZERO_EXTRACT
+ || GET_CODE (dest) == SUBREG
+ || GET_CODE (dest) == STRICT_LOW_PART)
+ dest = XEXP (dest, 0);
+ if (dest == x)
+ break;
}
/* Fall through. */