Commit 7dbe6ae9 by Bernd Schmidt Committed by Bernd Schmidt

Re-apply an earlier fix, with a small update

From-SVN: r37794
parent 76e57b45
...@@ -12,6 +12,11 @@ ...@@ -12,6 +12,11 @@
htab_find_slot_with_hash. htab_find_slot_with_hash.
(cselib_lookup): Likewise. (cselib_lookup): Likewise.
Based on a patch from Geoff Keating <geoffk@redhat.com>:
* loop.c (basic_induction_var): If a REG is set from something
that is not a biv, then the REG is not a biv. Even if it is
earlier set from something that is a biv.
2000-11-27 Alexandre Oliva <aoliva@redhat.com> 2000-11-27 Alexandre Oliva <aoliva@redhat.com>
* configure.in (extra_objs): Enclose extra_headers in quotes. * configure.in (extra_objs): Enclose extra_headers in quotes.
......
...@@ -5467,6 +5467,7 @@ basic_induction_var (loop, x, mode, dest_reg, p, inc_val, mult_val, location) ...@@ -5467,6 +5467,7 @@ basic_induction_var (loop, x, mode, dest_reg, p, inc_val, mult_val, location)
insn = p; insn = p;
while (1) while (1)
{ {
rtx dest;
do do
{ {
insn = PREV_INSN (insn); insn = PREV_INSN (insn);
...@@ -5479,21 +5480,26 @@ basic_induction_var (loop, x, mode, dest_reg, p, inc_val, mult_val, location) ...@@ -5479,21 +5480,26 @@ basic_induction_var (loop, x, mode, dest_reg, p, inc_val, mult_val, location)
set = single_set (insn); set = single_set (insn);
if (set == 0) if (set == 0)
break; break;
dest = SET_DEST (set);
if ((SET_DEST (set) == x if (dest == x
|| (GET_CODE (SET_DEST (set)) == SUBREG || (GET_CODE (dest) == SUBREG
&& (GET_MODE_SIZE (GET_MODE (SET_DEST (set))) && (GET_MODE_SIZE (GET_MODE (dest)) <= UNITS_PER_WORD)
<= UNITS_PER_WORD) && (GET_MODE_CLASS (GET_MODE (dest)) == MODE_INT)
&& (GET_MODE_CLASS (GET_MODE (SET_DEST (set))) && SUBREG_REG (dest) == x))
== MODE_INT) return basic_induction_var (loop, SET_SRC (set),
&& SUBREG_REG (SET_DEST (set)) == x)) (GET_MODE (SET_SRC (set)) == VOIDmode
&& basic_induction_var (loop, SET_SRC (set), ? GET_MODE (x)
(GET_MODE (SET_SRC (set)) == VOIDmode : GET_MODE (SET_SRC (set))),
? GET_MODE (x) dest_reg, insn,
: GET_MODE (SET_SRC (set))), inc_val, mult_val, location);
dest_reg, insn,
inc_val, mult_val, location)) while (GET_CODE (dest) == SIGN_EXTRACT
return 1; || 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. */ /* Fall through. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment