summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJim Wilson <wilson@cygnus.com>1998-04-27 19:24:06 +0000
committerJim Wilson <wilson@gcc.gnu.org>1998-04-27 12:24:06 -0700
commit561cf7b130aa8c70031ace121a516f7d92e8d8b2 (patch)
treef41ad05ed868a3d611a9bf1858631bbe1ddaf955 /gcc
parent1688d6d2c75c0a3b02144fa4479377da2c6818c7 (diff)
downloadgcc-561cf7b130aa8c70031ace121a516f7d92e8d8b2.tar.gz
Fix for x86 FP problem.
* reg-stack.c: Revert last patch (Apr 20). (convert_regs): Set insn to PREV_INSN (next) after do while loop. From-SVN: r19437
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog3
-rw-r--r--gcc/reg-stack.c48
2 files changed, 28 insertions, 23 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5b049e6838b..05f05ab7e4c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,8 @@
Mon Apr 27 18:36:28 1998 Jim Wilson <wilson@cygnus.com>
+ * reg-stack.c: Revert last patch (Apr 20).
+ (convert_regs): Set insn to PREV_INSN (next) after do while loop.
+
* m68k/lb1sf68.asm (Laddsf$3): Fix typos in mcf5200 exg code.
* loop.c (check_dbra_loop): New locals jump, first_compare, and
diff --git a/gcc/reg-stack.c b/gcc/reg-stack.c
index d4ef06bd4a1..255cb38524b 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 rtx subst_asm_stack_regs PROTO((rtx, stack, rtx *, rtx **,
+static void subst_asm_stack_regs PROTO((rtx, stack, rtx *, rtx **,
char **, int, int));
-static rtx subst_stack_regs PROTO((rtx, stack));
+static void subst_stack_regs PROTO((rtx, stack));
static void change_stack PROTO((rtx, stack, stack, rtx (*) ()));
static void goto_block_pat PROTO((rtx, stack, rtx));
@@ -2411,11 +2411,9 @@ 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. */
- It returns the last new insn generated by this function. */
-
-static rtx
+static void
subst_asm_stack_regs (insn, regstack, operands, operands_loc, constraints,
n_inputs, n_outputs)
rtx insn;
@@ -2694,18 +2692,14 @@ 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.
-
- It returns the last new insn generated by this function. */
+ stack for the 387 based on the contents of the insn. */
-static rtx
+static void
subst_stack_regs (insn, regstack)
rtx insn;
stack regstack;
@@ -2761,9 +2755,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);
- return subst_asm_stack_regs (insn, regstack, operands,
- operands_loc, constraints,
- n_inputs, n_outputs);
+ subst_asm_stack_regs (insn, regstack, operands, operands_loc,
+ constraints, n_inputs, n_outputs);
+ return;
}
if (GET_CODE (PATTERN (insn)) == PARALLEL)
@@ -2781,7 +2775,7 @@ subst_stack_regs (insn, regstack)
REG_UNUSED will already have been dealt with, so just return. */
if (GET_CODE (insn) == NOTE)
- return insn;
+ return;
/* If there is a REG_UNUSED note on a stack register on this insn,
the indicated reg must be popped. The REG_UNUSED note is removed,
@@ -2797,8 +2791,6 @@ 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
@@ -3039,7 +3031,7 @@ static void
convert_regs ()
{
register int block, reg;
- register rtx insn, next, new;
+ register rtx insn, next;
struct stack_def regstack;
for (block = 0; block < blocks; block++)
@@ -3065,7 +3057,6 @@ convert_regs ()
do
{
insn = next;
- new = insn;
next = NEXT_INSN (insn);
/* Don't bother processing unless there is a stack reg
@@ -3073,10 +3064,21 @@ convert_regs ()
floating point values). */
if (GET_MODE (insn) == QImode || GET_CODE (insn) == CALL_INSN)
- /* We may have generated some new instructions here. */
- new = subst_stack_regs (insn, &regstack);
+ subst_stack_regs (insn, &regstack);
} while (insn != block_end[block]);
+
+ /* For all further actions, INSN needs to be the last insn in
+ this basic block. If subst_stack_regs inserted additional
+ instructions after INSN, it is no longer the last one at
+ this point. */
+ next = PREV_INSN (next);
+
+ /* If subst_stack_regs inserted something after a JUMP_INSN, that
+ is almost certainly a bug. */
+ if (GET_CODE (insn) == JUMP_INSN && insn != next)
+ abort ();
+ insn = next;
/* Something failed if the stack life doesn't match. */
@@ -3097,7 +3099,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 (new, &regstack, &block_stack_in[block+1],
+ change_stack (insn, &regstack, &block_stack_in[block+1],
emit_insn_after);
}