This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [m68k] Fix and improve ColdFire function prologue/epilogue generation (respin)
On Thu, Sep 04, 2003 at 11:38:15AM +0200, Bernardo Innocenti wrote:
> Actually, it works fine with and without -fomit-frame-pointer.
> The reason is probably that GCC never invokes that function to
> eliminate the ARG_POINTER_REGNUM from HARD_FRAME_POINTER_REGNUM.
Indeed. I read that the wrong wat around. It never will
invoke with that, so there's no point checking for it.
> I think the correct value should be:
>
> if (from == ARG_POINTER_REGNUM && to == HARD_FRAME_POINTER_REGNUM)
> return (frame_pointer_needed ? -UNITS_PER_WORD * 2 : -UNITS_PER_WORD);
Yes.
> >m68k.h:#define FIRST_PARM_OFFSET(FNDECL) 8
> >
> >That says that the offset from ARG_POINTER_REGNUM to the first
> >actual argument is 8. Which, when you have a frame pointer, is
> >exactly right for m68k -- four bytes for saved frame pointer,
> >and four bytes for saved return address.
>
> What does GCC use that for? Its value gets assigned to the static
> variable `in_arg_offset' at function entry time and seems to be
> only used in instantiate_new_reg().
For instantiating virtual_incoming_args_rtx.
> No, it works fine indeed. Tested with a full build of Linux kernel and
> userland!
>
> There must be some other way of computing offsets to the arguments.
Hm...
> What's STACK_FRAME_POINTER_REGNUM? :-)
STACK_POINTER_REGNUM, sorry.
r~