summaryrefslogtreecommitdiff
path: root/gcc/config/s390
diff options
context:
space:
mode:
authorkrebbel <krebbel@138bc75d-0d04-0410-961f-82ee72b054a4>2008-11-12 18:04:39 +0000
committerkrebbel <krebbel@138bc75d-0d04-0410-961f-82ee72b054a4>2008-11-12 18:04:39 +0000
commit4f091f590ed9ac8ea6f8e91b6e1b5bb16381a1ee (patch)
tree03ae6dc0ab366f088eab600a3c8ad3a6b68c7181 /gcc/config/s390
parent96bf1d84afdab9072a5cf74b9b94cfc2d07a8a00 (diff)
downloadgcc-4f091f590ed9ac8ea6f8e91b6e1b5bb16381a1ee.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@141796 138bc75d-0d04-0410-961f-82ee72b054a4
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 a58bc3443fa..449c1b64e6e 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)))