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
This commit is contained in:
Andreas Krebbel 2005-06-29 15:21:42 +00:00 committed by Ulrich Weigand
parent a65da37d5b
commit 63296cb1fe
3 changed files with 31 additions and 14 deletions

View File

@ -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...

View File

@ -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:

View File

@ -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