aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeoffrey Keating <geoffk@redhat.com>2001-11-04 08:12:09 +0000
committerGeoffrey Keating <geoffk@gcc.gnu.org>2001-11-04 08:12:09 +0000
commit27d80140ec45347e4042fb9e1c1e86a08ce45d52 (patch)
treeffac8087938d67c9112369b7ccc976df3f3c1caf
parent3eaaf577ce49b0572ef51a143d7540a0fed3e117 (diff)
downloadgcc-27d80140ec45347e4042fb9e1c1e86a08ce45d52.zip
gcc-27d80140ec45347e4042fb9e1c1e86a08ce45d52.tar.gz
gcc-27d80140ec45347e4042fb9e1c1e86a08ce45d52.tar.bz2
unroll.c (calculate_giv_inc): Use find_last_value rather than just hoping the last instruction is the right SET.
* unroll.c (calculate_giv_inc): Use find_last_value rather than just hoping the last instruction is the right SET. [Fixes 990604-1.c on stormy16.] From-SVN: r46769
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/unroll.c11
2 files changed, 9 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3d875ee..4d1bacc 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,9 @@
2001-11-03 Geoffrey Keating <geoffk@redhat.com>
+ * unroll.c (calculate_giv_inc): Use find_last_value rather
+ than just hoping the last instruction is the right SET.
+ [Fixes 990604-1.c on stormy16.]
+
* config/stormy16/stormy16.h (LIB_SPEC): Don't supply any libgloss
library at all if -T is used.
diff --git a/gcc/unroll.c b/gcc/unroll.c
index 97e968e..c1d6238 100644
--- a/gcc/unroll.c
+++ b/gcc/unroll.c
@@ -1556,7 +1556,7 @@ calculate_giv_inc (pattern, src_insn, regno)
/* SR sometimes computes the new giv value in a temp, then copies it
to the new_reg. */
src_insn = PREV_INSN (src_insn);
- pattern = PATTERN (src_insn);
+ pattern = single_set (src_insn);
if (GET_CODE (SET_SRC (pattern)) != PLUS)
abort ();
@@ -1571,8 +1571,7 @@ calculate_giv_inc (pattern, src_insn, regno)
{
/* SR sometimes puts the constant in a register, especially if it is
too big to be an add immed operand. */
- src_insn = PREV_INSN (src_insn);
- increment = SET_SRC (PATTERN (src_insn));
+ increment = find_last_value (increment, &src_insn, NULL_RTX, 0);
/* SR may have used LO_SUM to compute the constant if it is too large
for a load immed operand. In this case, the constant is in operand
@@ -1598,8 +1597,8 @@ calculate_giv_inc (pattern, src_insn, regno)
rtx second_part = XEXP (increment, 1);
enum rtx_code code = GET_CODE (increment);
- src_insn = PREV_INSN (src_insn);
- increment = SET_SRC (PATTERN (src_insn));
+ increment = find_last_value (XEXP (increment, 0),
+ &src_insn, NULL_RTX, 0);
/* Don't need the last insn anymore. */
delete_related_insns (get_last_insn ());
@@ -1642,7 +1641,7 @@ calculate_giv_inc (pattern, src_insn, regno)
tries++;
src_insn = PREV_INSN (src_insn);
- pattern = PATTERN (src_insn);
+ pattern = single_set (src_insn);
delete_related_insns (get_last_insn ());