(basic_induction_var, case REG): Allow previous insn to set a SUBREG
authorRichard Kenner <kenner@gcc.gnu.org>
Wed, 29 Jun 1994 23:21:43 +0000 (19:21 -0400)
committerRichard Kenner <kenner@gcc.gnu.org>
Wed, 29 Jun 1994 23:21:43 +0000 (19:21 -0400)
of X.

From-SVN: r7611

gcc/loop.c

index 31e7a6e79cee2a2231c51eda4ebae4592adbffe4..c6caefe93d7aed41bb312d276ea428526061f483 100644 (file)
@@ -4834,7 +4834,12 @@ basic_induction_var (x, mode, dest_reg, p, inc_val, mult_val)
       if (insn)
        set = single_set (insn);
 
-      if (set != 0 && SET_DEST (set) == x)
+      if (set != 0
+         && (SET_DEST (set) == x
+             || (GET_CODE (SET_DEST (set)) == SUBREG
+                 && (GET_MODE_SIZE (GET_MODE (SET_DEST (set)))
+                     <= UNITS_PER_WORD)
+                 && SUBREG_REG (SET_DEST (set)) == x)))
        return basic_induction_var (SET_SRC (set),
                                    (GET_MODE (SET_SRC (set)) == VOIDmode
                                     ? GET_MODE (x)