diff options
author | Andreas Krebbel <krebbel1@de.ibm.com> | 2007-12-06 09:59:06 +0000 |
---|---|---|
committer | Andreas Krebbel <krebbel@gcc.gnu.org> | 2007-12-06 09:59:06 +0000 |
commit | 12959abe9ee629768541ebcba0cbc12865d5b8af (patch) | |
tree | 7155ceccabc37e24f862e71bd78b3d184028ef8b /gcc/config | |
parent | 28267cfcce273646cf39bca5401428cb53429481 (diff) | |
download | gcc-12959abe9ee629768541ebcba0cbc12865d5b8af.zip gcc-12959abe9ee629768541ebcba0cbc12865d5b8af.tar.gz gcc-12959abe9ee629768541ebcba0cbc12865d5b8af.tar.bz2 |
s390.c (s390_emit_stack_tie): New function.
2007-12-06 Andreas Krebbel <krebbel1@de.ibm.com>
* config/s390/s390.c (s390_emit_stack_tie): New function.
(s390_emit_prologue): Emit a stack tie when writing to the
f8-f15 stack slots.
* config/s390/s390.md ("stack_tie"): New insn definition.
From-SVN: r130646
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/s390/s390.c | 17 | ||||
-rw-r--r-- | gcc/config/s390/s390.md | 11 |
2 files changed, 28 insertions, 0 deletions
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index 35e2fa6..c1c4668 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -7162,6 +7162,18 @@ s390_load_got (void) return insns; } +/* This ties together stack memory (MEM with an alias set of frame_alias_set) + and the change to the stack pointer. */ + +static void +s390_emit_stack_tie (void) +{ + rtx mem = gen_frame_mem (BLKmode, + gen_rtx_REG (Pmode, STACK_POINTER_REGNUM)); + + emit_insn (gen_stack_tie (mem)); +} + /* Expand the prologue into a bunch of separate insns. */ void @@ -7390,6 +7402,11 @@ s390_emit_prologue (void) if (cfun_save_high_fprs_p && next_fpr) { + /* If the stack might be accessed through a different register + we have to make sure that the stack pointer decrement is not + moved below the use of the stack slots. */ + s390_emit_stack_tie (); + insn = emit_insn (gen_add2_insn (temp_reg, GEN_INT (cfun_frame_layout.f8_offset))); diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md index fbabfdd..670ae13 100644 --- a/gcc/config/s390/s390.md +++ b/gcc/config/s390/s390.md @@ -61,6 +61,7 @@ (UNSPEC_CCU_TO_INT 2) (UNSPEC_CCZ_TO_INT 3) (UNSPEC_ICM 10) + (UNSPEC_TIE 11) ; GOT/PLT and lt-relative accesses (UNSPEC_LTREL_OFFSET 100) @@ -7971,3 +7972,13 @@ "" "clc\t%O0(%G0,%R0),%S1" [(set_attr "op_type" "SS")]) + +; This is used in s390_emit_prologue in order to prevent insns +; adjusting the stack pointer to be moved over insns writing stack +; slots using a copy of the stack pointer in a different register. +(define_insn "stack_tie" + [(set (match_operand:BLK 0 "memory_operand" "+m") + (unspec:BLK [(match_dup 0)] UNSPEC_TIE))] + "" + "" + [(set_attr "length" "0")]) |