m68k.h (RETURN_ADDR_RTX): Define.

2005-12-29  Paul Brook  <paul@codesourcery.com>

	* config/m68k/m68k.h (RETURN_ADDR_RTX): Define.
	* config/m68k/m68k.c (m68k_initial_elimination_offset): Remove FIXME.
	Include offset due to FIRST_PARM_OFFSET.

From-SVN: r109147
This commit is contained in:
Paul Brook 2005-12-29 15:23:23 +00:00 committed by Paul Brook
parent 1a50d5e9d2
commit 42b67c06ed
3 changed files with 19 additions and 6 deletions

View File

@ -1,3 +1,9 @@
2005-12-29 Paul Brook <paul@codesourcery.com>
* config/m68k/m68k.h (RETURN_ADDR_RTX): Define.
* config/m68k/m68k.c (m68k_initial_elimination_offset): Remove FIXME.
Include offset due to FIRST_PARM_OFFSET.
2005-12-29 Paul Brook <paul@codesourcery.com>
* config/m68k/lb1sf68.asm (__cmpdf2): Fix typo in immediate mask.

View File

@ -434,11 +434,13 @@ m68k_compute_frame_layout (void)
HOST_WIDE_INT
m68k_initial_elimination_offset (int from, int to)
{
/* FIXME: The correct offset to compute here would appear to be
(frame_pointer_needed ? -UNITS_PER_WORD * 2 : -UNITS_PER_WORD);
but for some obscure reason, this must be 0 to get correct code. */
int argptr_offset;
/* The arg pointer points 8 bytes before the start of the arguments,
as defined by FIRST_PARM_OFFSET. This makes it coincident with the
frame pointer in most frames. */
argptr_offset = frame_pointer_needed ? 0 : UNITS_PER_WORD;
if (from == ARG_POINTER_REGNUM && to == FRAME_POINTER_REGNUM)
return 0;
return argptr_offset;
m68k_compute_frame_layout ();
@ -446,8 +448,7 @@ m68k_initial_elimination_offset (int from, int to)
switch (from)
{
case ARG_POINTER_REGNUM:
return (current_frame.offset + current_frame.size
+ (frame_pointer_needed ? -UNITS_PER_WORD * 2 : -UNITS_PER_WORD));
return current_frame.offset + current_frame.size - argptr_offset;
case FRAME_POINTER_REGNUM:
return current_frame.offset + current_frame.size;
default:

View File

@ -890,6 +890,12 @@ do { if (cc_prev_status.flags & CC_IN_68881) \
#define INCOMING_RETURN_ADDR_RTX \
gen_rtx_MEM (VOIDmode, gen_rtx_REG (VOIDmode, STACK_POINTER_REGNUM))
/* After the prologue, RA is at 4(AP) in the current frame. */
#define RETURN_ADDR_RTX(COUNT, FRAME) \
((COUNT) == 0 \
? gen_rtx_MEM (Pmode, plus_constant (arg_pointer_rtx, UNITS_PER_WORD)) \
: gen_rtx_MEM (Pmode, plus_constant (FRAME, UNITS_PER_WORD)))
/* We must not use the DBX register numbers for the DWARF 2 CFA column
numbers because that maps to numbers beyond FIRST_PSEUDO_REGISTER.
Instead use the identity mapping. */