summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hjl@gnu.org>1998-04-19 23:59:57 +0000
committerJeff Law <law@gcc.gnu.org>1998-04-19 17:59:57 -0600
commit620a5a20ec15115bb7e1ebf3a2f3ac416d10a1ab (patch)
treee4ed6baddbf260ee65fd8a4b45c0a2a29e9ce791
parentbee14d86c60c156b3a1521d8c1e8ff87434b1f3e (diff)
downloadgcc-620a5a20ec15115bb7e1ebf3a2f3ac416d10a1ab.tar.gz
reg-stack.c (subst_asm_stack_regs): Change to return the last new insn generated by this function.
* reg-stack.c (subst_asm_stack_regs): Change to return the last new insn generated by this function. (subst_stack_regs): Likewise. (convert_regs): Record the last newly generated insn and use it for change_stack () instead of INSN. From-SVN: r19327
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/reg-stack.c36
2 files changed, 31 insertions, 13 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e11525528a0..e1ca3cf3e5b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+Mon Apr 20 00:58:48 1998 H.J. Lu (hjl@gnu.org)
+
+ * reg-stack.c (subst_asm_stack_regs): Change to return the last
+ new insn generated by this function.
+ (subst_stack_regs): Likewise.
+ (convert_regs): Record the last newly generated insn and use
+ it for change_stack () instead of INSN.
+
Sun Apr 19 00:23:23 1998 Richard Henderson <rth@cygnus.com>
* alpha.md (extendsidi2): Kill bogus cvtql+cvtlq case.
diff --git a/gcc/reg-stack.c b/gcc/reg-stack.c
index 2f3a4a72be2..7b8c6269cde 100644
--- a/gcc/reg-stack.c
+++ b/gcc/reg-stack.c
@@ -262,9 +262,9 @@ static void move_for_stack_reg PROTO((rtx, stack, rtx));
static void swap_rtx_condition PROTO((rtx));
static void compare_for_stack_reg PROTO((rtx, stack, rtx));
static void subst_stack_regs_pat PROTO((rtx, stack, rtx));
-static void subst_asm_stack_regs PROTO((rtx, stack, rtx *, rtx **,
+static rtx subst_asm_stack_regs PROTO((rtx, stack, rtx *, rtx **,
char **, int, int));
-static void subst_stack_regs PROTO((rtx, stack));
+static rtx subst_stack_regs PROTO((rtx, stack));
static void change_stack PROTO((rtx, stack, stack, rtx (*) ()));
static void goto_block_pat PROTO((rtx, stack, rtx));
@@ -2407,9 +2407,11 @@ subst_stack_regs_pat (insn, regstack, pat)
stack-like regs in asm statements. These rules are enforced by
record_asm_stack_regs; see comments there for details. Any
asm_operands left in the RTL at this point may be assume to meet the
- requirements, since record_asm_stack_regs removes any problem asm. */
+ requirements, since record_asm_stack_regs removes any problem asm.
-static void
+ It returns the last new insn generated by this function. */
+
+static rtx
subst_asm_stack_regs (insn, regstack, operands, operands_loc, constraints,
n_inputs, n_outputs)
rtx insn;
@@ -2688,14 +2690,18 @@ subst_asm_stack_regs (insn, regstack, operands, operands_loc, constraints,
break;
}
}
+
+ return insn;
}
/* Substitute stack hard reg numbers for stack virtual registers in
INSN. Non-stack register numbers are not changed. REGSTACK is the
current stack content. Insns may be emitted as needed to arrange the
- stack for the 387 based on the contents of the insn. */
+ stack for the 387 based on the contents of the insn.
-static void
+ It returns the last new insn generated by this function. */
+
+static rtx
subst_stack_regs (insn, regstack)
rtx insn;
stack regstack;
@@ -2752,9 +2758,9 @@ subst_stack_regs (insn, regstack)
decode_asm_operands (body, operands, operands_loc,
constraints, NULL_PTR);
get_asm_operand_lengths (body, n_operands, &n_inputs, &n_outputs);
- subst_asm_stack_regs (insn, regstack, operands, operands_loc,
- constraints, n_inputs, n_outputs);
- return;
+ return subst_asm_stack_regs (insn, regstack, operands,
+ operands_loc, constraints,
+ n_inputs, n_outputs);
}
if (GET_CODE (PATTERN (insn)) == PARALLEL)
@@ -2772,7 +2778,7 @@ subst_stack_regs (insn, regstack)
REG_UNUSED will already have been dealt with, so just return. */
if (GET_CODE (insn) == NOTE)
- return;
+ return insn;
/* If we are reached by a computed goto which sets this same stack register,
then pop this stack register, but maintain regstack. */
@@ -2821,6 +2827,8 @@ subst_stack_regs (insn, regstack)
}
else
note_link = &XEXP (note, 1);
+
+ return insn;
}
/* Change the organization of the stack so that it fits a new basic
@@ -3061,7 +3069,7 @@ static void
convert_regs ()
{
register int block, reg;
- register rtx insn, next;
+ register rtx insn, next, new;
struct stack_def regstack;
for (block = 0; block < blocks; block++)
@@ -3087,6 +3095,7 @@ convert_regs ()
do
{
insn = next;
+ new = insn;
next = NEXT_INSN (insn);
/* Don't bother processing unless there is a stack reg
@@ -3094,7 +3103,8 @@ convert_regs ()
floating point values). */
if (GET_MODE (insn) == QImode || GET_CODE (insn) == CALL_INSN)
- subst_stack_regs (insn, &regstack);
+ /* We may have generated some new instructions here. */
+ new = subst_stack_regs (insn, &regstack);
} while (insn != block_end[block]);
@@ -3117,7 +3127,7 @@ convert_regs ()
/* Likewise handle the case where we fall into the next block. */
if ((block < blocks - 1) && block_drops_in[block+1])
- change_stack (insn, &regstack, &block_stack_in[block+1],
+ change_stack (new, &regstack, &block_stack_in[block+1],
emit_insn_after);
}