aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAndreas Krebbel <krebbel1@de.ibm.com>2005-06-29 15:21:42 +0000
committerUlrich Weigand <uweigand@gcc.gnu.org>2005-06-29 15:21:42 +0000
commit63296cb1fedf5f58b90783fab73c90760b5e315b (patch)
treeb5fd9a7daafd083c53f429f31a0adcc661a4cd5d /gcc
parenta65da37d5b360c62f632e008a5c717f60a07b4be (diff)
downloadgcc-63296cb1fedf5f58b90783fab73c90760b5e315b.zip
gcc-63296cb1fedf5f58b90783fab73c90760b5e315b.tar.gz
gcc-63296cb1fedf5f58b90783fab73c90760b5e315b.tar.bz2
s390.c (s390_decompose_address): Accept invalid displacements for addresses containing frame_pointer_rtx or...
2005-06-29 Andreas Krebbel <krebbel1@de.ibm.com> * config/s390/s390.c (s390_decompose_address): Accept invalid displacements for addresses containing frame_pointer_rtx or virtual_stack_vars_rtx. (s390_frame_info): Replaced use of STARTING_FRAME_OFFSET. (s390_initial_elimination_offset): New offset when eliminating the soft frame pointer. * config/s390/s390.h (FRAME_GROWS_DOWNWARD): Defined as 1. (STARTING_FRAME_OFFSET, STACK_DYNAMIC_OFFSET): Definitions changed. From-SVN: r101422
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog11
-rw-r--r--gcc/config/s390/s390.c24
-rw-r--r--gcc/config/s390/s390.h10
3 files changed, 31 insertions, 14 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 708f198..151a7c8 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,14 @@
+2005-06-29 Andreas Krebbel <krebbel1@de.ibm.com>
+
+ * config/s390/s390.c (s390_decompose_address): Accept invalid
+ displacements for addresses containing frame_pointer_rtx or
+ virtual_stack_vars_rtx.
+ (s390_frame_info): Replaced use of STARTING_FRAME_OFFSET.
+ (s390_initial_elimination_offset): New offset when eliminating the
+ soft frame pointer.
+ * config/s390/s390.h (FRAME_GROWS_DOWNWARD): Defined as 1.
+ (STARTING_FRAME_OFFSET, STACK_DYNAMIC_OFFSET): Definitions changed.
+
2006-06-28 Ziemowit Laski <zlaski@apple.com>
* c-common.c (flag_next_runtime): Move...
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index 6311833..1dfefc5 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -1490,19 +1490,22 @@ s390_decompose_address (rtx addr, struct s390_address *out)
/* Validate displacement. */
if (!disp)
{
- /* If the argument pointer or the return address pointer are involved,
- the displacement will change later anyway as the virtual registers get
- eliminated. This could make a valid displacement invalid, but it is
- more likely to make an invalid displacement valid, because we sometimes
- access the register save area via negative offsets to one of those
- registers.
+ /* If virtual registers are involved, the displacement will change later
+ anyway as the virtual registers get eliminated. This could make a
+ valid displacement invalid, but it is more likely to make an invalid
+ displacement valid, because we sometimes access the register save area
+ via negative offsets to one of those registers.
Thus we don't check the displacement for validity here. If after
elimination the displacement turns out to be invalid after all,
this is fixed up by reload in any case. */
if (base != arg_pointer_rtx
&& indx != arg_pointer_rtx
&& base != return_address_pointer_rtx
- && indx != return_address_pointer_rtx)
+ && indx != return_address_pointer_rtx
+ && base != frame_pointer_rtx
+ && indx != frame_pointer_rtx
+ && base != virtual_stack_vars_rtx
+ && indx != virtual_stack_vars_rtx)
if (!DISP_IN_RANGE (offset))
return false;
}
@@ -5865,7 +5868,8 @@ s390_frame_info (void)
return;
if (!TARGET_PACKED_STACK)
- cfun_frame_layout.frame_size += (STARTING_FRAME_OFFSET
+ cfun_frame_layout.frame_size += (STACK_POINTER_OFFSET
+ + current_function_outgoing_args_size
+ cfun_frame_layout.high_fprs * 8);
else
{
@@ -6008,7 +6012,9 @@ s390_initial_elimination_offset (int from, int to)
switch (from)
{
case FRAME_POINTER_REGNUM:
- offset = 0;
+ offset = (get_frame_size()
+ + STACK_POINTER_OFFSET
+ + current_function_outgoing_args_size);
break;
case ARG_POINTER_REGNUM:
diff --git a/gcc/config/s390/s390.h b/gcc/config/s390/s390.h
index 77387e6..42119a4 100644
--- a/gcc/config/s390/s390.h
+++ b/gcc/config/s390/s390.h
@@ -506,7 +506,7 @@ extern const enum reg_class regclass_map[FIRST_PSEUDO_REGISTER];
are accessed by positive offsets, and function arguments are stored at
increasing addresses. */
#define STACK_GROWS_DOWNWARD
-/* #define FRAME_GROWS_DOWNWARD 0 */
+#define FRAME_GROWS_DOWNWARD 1
/* #undef ARGS_GROW_DOWNWARD */
/* The basic stack layout looks like this: the stack pointer points
@@ -518,13 +518,13 @@ extern const enum reg_class regclass_map[FIRST_PSEUDO_REGISTER];
#define STACK_POINTER_OFFSET (TARGET_64BIT ? 160 : 96)
/* Offset within stack frame to start allocating local variables at. */
-extern int current_function_outgoing_args_size;
-#define STARTING_FRAME_OFFSET \
- (STACK_POINTER_OFFSET + current_function_outgoing_args_size)
+#define STARTING_FRAME_OFFSET 0
/* Offset from the stack pointer register to an item dynamically
allocated on the stack, e.g., by `alloca'. */
-#define STACK_DYNAMIC_OFFSET(FUNDECL) (STARTING_FRAME_OFFSET)
+extern int current_function_outgoing_args_size;
+#define STACK_DYNAMIC_OFFSET(FUNDECL) \
+ (STACK_POINTER_OFFSET + current_function_outgoing_args_size)
/* Offset of first parameter from the argument pointer register value.
We have a fake argument pointer register that points directly to