aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/s390
diff options
context:
space:
mode:
authorAndreas Krebbel <krebbel@gcc.gnu.org>2008-11-12 18:04:39 +0000
committerAndreas Krebbel <krebbel@gcc.gnu.org>2008-11-12 18:04:39 +0000
commit78791a80a8bfde263eb3cb2c786efa5b6f973142 (patch)
tree03ae6dc0ab366f088eab600a3c8ad3a6b68c7181 /gcc/config/s390
parent2069a97a4a6bab22048158add3db32d6b38f0021 (diff)
downloadgcc-78791a80a8bfde263eb3cb2c786efa5b6f973142.zip
gcc-78791a80a8bfde263eb3cb2c786efa5b6f973142.tar.gz
gcc-78791a80a8bfde263eb3cb2c786efa5b6f973142.tar.bz2
[multiple changes]
2008-11-12 Ulrich Weigand <Ulrich.Weigand@de.ibm.com> * gcc/config/s390/s390.h (INITIAL_FRAME_ADDRESS_RTX): Remove packed-stack special handling. (FRAME_ADDR_RTX): Add definition. 2008-11-12 Andreas Krebbel <krebbel1@de.ibm.com> * gcc.target/s390/frame-addr1.c: New testcase. * gcc.target/s390/frame-addr2.c: New testcase. * gcc.target/s390/return-addr1.c: New testcase. * gcc.target/s390/return-addr2.c: New testcase. From-SVN: r141796
Diffstat (limited to 'gcc/config/s390')
-rw-r--r--gcc/config/s390/s390.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/gcc/config/s390/s390.h b/gcc/config/s390/s390.h
index a58bc34..449c1b6 100644
--- a/gcc/config/s390/s390.h
+++ b/gcc/config/s390/s390.h
@@ -574,9 +574,7 @@ extern const enum reg_class regclass_map[FIRST_PSEUDO_REGISTER];
/* Defining this macro makes __builtin_frame_address(0) and
__builtin_return_address(0) work with -fomit-frame-pointer. */
#define INITIAL_FRAME_ADDRESS_RTX \
- (TARGET_PACKED_STACK ? \
- plus_constant (arg_pointer_rtx, -UNITS_PER_WORD) : \
- plus_constant (arg_pointer_rtx, -STACK_POINTER_OFFSET))
+ (plus_constant (arg_pointer_rtx, -STACK_POINTER_OFFSET))
/* The return address of the current frame is retrieved
from the initial value of register RETURN_REGNUM.
@@ -586,6 +584,16 @@ extern const enum reg_class regclass_map[FIRST_PSEUDO_REGISTER];
(TARGET_PACKED_STACK ? \
plus_constant ((FRAME), STACK_POINTER_OFFSET - UNITS_PER_WORD) : (FRAME))
+/* For -mpacked-stack this adds 160 - 8 (96 - 4) to the output of
+ builtin_frame_address. Otherwise arg pointer -
+ STACK_POINTER_OFFSET would be returned for
+ __builtin_frame_address(0) what might result in an address pointing
+ somewhere into the middle of the local variables since the packed
+ stack layout generally does not need all the bytes in the register
+ save area. */
+#define FRAME_ADDR_RTX(FRAME) \
+ DYNAMIC_CHAIN_ADDRESS ((FRAME))
+
#define RETURN_ADDR_RTX(COUNT, FRAME) \
s390_return_addr_rtx ((COUNT), DYNAMIC_CHAIN_ADDRESS ((FRAME)))