summaryrefslogtreecommitdiff
path: root/gcc/unroll.c
diff options
context:
space:
mode:
authorgeoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4>2001-11-04 08:12:09 +0000
committergeoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4>2001-11-04 08:12:09 +0000
commit7849463682d4aab24da8cbb0d8bdd241c3a28718 (patch)
treeffac8087938d67c9112369b7ccc976df3f3c1caf /gcc/unroll.c
parente959aa625711ff7f50e6799e9d99859d1b11232b (diff)
downloadgcc-7849463682d4aab24da8cbb0d8bdd241c3a28718.tar.gz
* 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.] git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@46769 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/unroll.c')
-rw-r--r--gcc/unroll.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/gcc/unroll.c b/gcc/unroll.c
index 97e968e5a24..c1d62383540 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 ());