i386.md (pop): pop increments the stack pointer.

* i386.md (pop): pop increments the stack pointer.
        (prologue_set_stack_ptr): New pattern.
        * i386.c (ix86_expand_prologue): Use prologue_set_stack_ptr
        instead of subsi3.
Fixes problem with scheduling on the x86.

From-SVN: r14956
This commit is contained in:
Bernd Schmidt 1997-08-27 06:29:59 +00:00 committed by Jeff Law
parent b9e6eb36ff
commit 47d3640028
3 changed files with 30 additions and 2 deletions

View File

@ -1,3 +1,10 @@
Wed Aug 27 00:30:00 1997 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
* i386.md (pop): pop increments the stack pointer.
(prologue_set_stack_ptr): New pattern.
* i386.c (ix86_expand_prologue): Use prologue_set_stack_ptr
instead of subsi3.
Tue Aug 26 18:50:32 1997 Jim Wilson <wilson@cygnus.com>
* reload.c (find_reloads, case '0'): Reject matching a non-offsettable

View File

@ -1973,7 +1973,7 @@ ix86_expand_prologue ()
;
else if (! TARGET_STACK_PROBE || tsize < CHECK_STACK_LIMIT)
{
insn = emit_insn (gen_subsi3 (xops[0], xops[0], xops[2]));
insn = emit_insn (gen_prologue_set_stack_ptr (xops[2]));
RTX_FRAME_RELATED_P (insn) = 1;
}
else

View File

@ -60,6 +60,9 @@
;; operand 0 is the argument for `cos'.
;; 3 This is part of a `stack probe' operation. The mode of the UNSPEC is
;; always SImode. operand 0 is the size of the stack allocation.
;; 4 This is the source of a fake SET of the frame pointer which is used to
;; prevent insns referencing it being scheduled across the initial
;; decrement of the stack pointer.
;; This shadows the processor_type enumeration, so changes must be made
;; to i386.h at the same time.
@ -6492,6 +6495,24 @@ byte_xor_operation:
DONE;
}")
;; The use of UNSPEC here is currently not necessary - a simple SET of ebp
;; to itself would be enough. But this way we are safe even if some optimizer
;; becomes too clever in the future.
(define_insn "prologue_set_stack_ptr"
[(set (reg:SI 7)
(minus:SI (reg:SI 7) (match_operand:SI 0 "immediate_operand" "i")))
(set (reg:SI 6) (unspec:SI [(reg:SI 6)] 4))]
""
"*
{
rtx xops [2];
xops[0] = operands[0];
xops[1] = stack_pointer_rtx;
output_asm_insn (AS2 (sub%L1,%0,%1), xops);
RET;
}")
(define_insn "prologue_set_got"
[(set (match_operand:SI 0 "" "")
(plus:SI (match_dup 0)
@ -6564,7 +6585,7 @@ byte_xor_operation:
(define_insn "pop"
[(set (match_operand:SI 0 "register_operand" "r")
(mem:SI (reg:SI 7)))
(set (reg:SI 7) (minus:SI (reg:SI 7) (const_int 4)))]
(set (reg:SI 7) (plus:SI (reg:SI 7) (const_int 4)))]
""
"*
{