Commit b74cf1ce by Jan Hubicka Committed by Jan Hubicka

* reg-stack.c (subst_stack_regs_pat): Fix fcmov reversal code.

From-SVN: r45490
parent 718fd87e
Sat Sep 8 22:00:55 CEST 2001 Jan Hubicka <jh@suse.cz>
* reg-stack.c (subst_stack_regs_pat): Fix fcmov reversal code.
2001-09-08 Andreas Jaeger <aj@suse.de> 2001-09-08 Andreas Jaeger <aj@suse.de>
* i386.h (TARGET_SWITCHES): Fix description. * i386.h (TARGET_SWITCHES): Fix description.
......
...@@ -1797,20 +1797,18 @@ subst_stack_regs_pat (insn, regstack, pat) ...@@ -1797,20 +1797,18 @@ subst_stack_regs_pat (insn, regstack, pat)
|| (REGNO (*src2) == regstack->reg[regstack->top] || (REGNO (*src2) == regstack->reg[regstack->top]
&& src2_note)) && src2_note))
{ {
int idx1 = (get_hard_regnum (regstack, *src1)
/* We know that both sources "dies", as one dies and other - FIRST_STACK_REG);
is overwriten by the destination. Claim both sources int idx2 = (get_hard_regnum (regstack, *src2)
to be dead, as the code bellow will properly pop the - FIRST_STACK_REG);
non-top-of-stack note and replace top-of-stack by the
result by popping source first and then pushing result. */ /* Make reg-stack believe that the operands are already
if (!src1_note) swapped on the stack */
src1_note = REG_NOTES (insn) regstack->reg[regstack->top - idx1] = REGNO (*src2);
= gen_rtx_EXPR_LIST (REG_DEAD, *src1, REG_NOTES (insn)); regstack->reg[regstack->top - idx2] = REGNO (*src1);
if (!src2_note)
src2_note = REG_NOTES (insn) /* Reverse condition to compensate the operand swap.
= gen_rtx_EXPR_LIST (REG_DEAD, *src2, REG_NOTES (insn)); i386 do have comparison always reversible. */
/* i386 do have comparison always reversible. */
PUT_CODE (XEXP (pat_src, 0), PUT_CODE (XEXP (pat_src, 0),
reversed_comparison_code (XEXP (pat_src, 0), insn)); reversed_comparison_code (XEXP (pat_src, 0), insn));
} }
...@@ -1845,11 +1843,9 @@ subst_stack_regs_pat (insn, regstack, pat) ...@@ -1845,11 +1843,9 @@ subst_stack_regs_pat (insn, regstack, pat)
EMIT_AFTER); EMIT_AFTER);
} }
else else
{ /* Top of stack never dies, as it is the
CLEAR_HARD_REG_BIT (regstack->reg_set, regno); destination. */
replace_reg (&XEXP (src_note[i], 0), FIRST_STACK_REG); abort ();
regstack->top--;
}
} }
} }
......
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