aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernd Schmidt <crux@pool.informatik.rwth-aachen.de>1997-08-27 06:29:59 +0000
committerJeff Law <law@gcc.gnu.org>1997-08-27 00:29:59 -0600
commit47d3640028b6647601a18cc8f84f3180c85f045e (patch)
tree70fe87aae510cad31198e0714fee8554b25c0c43
parentb9e6eb36ff871a2b0216d06e4b55183643eadc24 (diff)
downloadgcc-47d3640028b6647601a18cc8f84f3180c85f045e.zip
gcc-47d3640028b6647601a18cc8f84f3180c85f045e.tar.gz
gcc-47d3640028b6647601a18cc8f84f3180c85f045e.tar.bz2
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
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/config/i386/i386.c2
-rw-r--r--gcc/config/i386/i386.md23
3 files changed, 30 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 9f556ba..c8fc1a9 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 129727f..35dbc62 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -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
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 3b2a4eb..8ae8764 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -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)))]
""
"*
{