Commit 27d80140 by Geoffrey Keating Committed by Geoffrey Keating

unroll.c (calculate_giv_inc): Use find_last_value rather than just hoping the…

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
parent 3eaaf577
2001-11-03 Geoffrey Keating <geoffk@redhat.com> 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 * config/stormy16/stormy16.h (LIB_SPEC): Don't supply any libgloss
library at all if -T is used. library at all if -T is used.
......
...@@ -1556,7 +1556,7 @@ calculate_giv_inc (pattern, src_insn, regno) ...@@ -1556,7 +1556,7 @@ calculate_giv_inc (pattern, src_insn, regno)
/* SR sometimes computes the new giv value in a temp, then copies it /* SR sometimes computes the new giv value in a temp, then copies it
to the new_reg. */ to the new_reg. */
src_insn = PREV_INSN (src_insn); src_insn = PREV_INSN (src_insn);
pattern = PATTERN (src_insn); pattern = single_set (src_insn);
if (GET_CODE (SET_SRC (pattern)) != PLUS) if (GET_CODE (SET_SRC (pattern)) != PLUS)
abort (); abort ();
...@@ -1571,8 +1571,7 @@ calculate_giv_inc (pattern, src_insn, regno) ...@@ -1571,8 +1571,7 @@ calculate_giv_inc (pattern, src_insn, regno)
{ {
/* SR sometimes puts the constant in a register, especially if it is /* SR sometimes puts the constant in a register, especially if it is
too big to be an add immed operand. */ too big to be an add immed operand. */
src_insn = PREV_INSN (src_insn); increment = find_last_value (increment, &src_insn, NULL_RTX, 0);
increment = SET_SRC (PATTERN (src_insn));
/* SR may have used LO_SUM to compute the constant if it is too large /* 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 for a load immed operand. In this case, the constant is in operand
...@@ -1598,8 +1597,8 @@ calculate_giv_inc (pattern, src_insn, regno) ...@@ -1598,8 +1597,8 @@ calculate_giv_inc (pattern, src_insn, regno)
rtx second_part = XEXP (increment, 1); rtx second_part = XEXP (increment, 1);
enum rtx_code code = GET_CODE (increment); enum rtx_code code = GET_CODE (increment);
src_insn = PREV_INSN (src_insn); increment = find_last_value (XEXP (increment, 0),
increment = SET_SRC (PATTERN (src_insn)); &src_insn, NULL_RTX, 0);
/* Don't need the last insn anymore. */ /* Don't need the last insn anymore. */
delete_related_insns (get_last_insn ()); delete_related_insns (get_last_insn ());
...@@ -1642,7 +1641,7 @@ calculate_giv_inc (pattern, src_insn, regno) ...@@ -1642,7 +1641,7 @@ calculate_giv_inc (pattern, src_insn, regno)
tries++; tries++;
src_insn = PREV_INSN (src_insn); src_insn = PREV_INSN (src_insn);
pattern = PATTERN (src_insn); pattern = single_set (src_insn);
delete_related_insns (get_last_insn ()); delete_related_insns (get_last_insn ());
......
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