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
- From: Gunther Nikl <gni at gecko dot de>
- To: Bernardo Innocenti <bernie at develer dot com>
- Cc: Richard Henderson <rth at redhat dot com>, gcc-patches at gcc dot gnu dot org, Peter Barada <peter at baradas dot org>
- Date: Wed, 3 Sep 2003 18:10:51 +0200
- Subject: Re: [m68k] Fix and improve ColdFire function prologue/epilogue generation
- References: <200308130240.03115.bernie@develer.com> <20030828231409.GE5175@redhat.com> <3F55D07A.9010801@develer.com>
On Wed, Sep 03, 2003 at 01:28:58PM +0200, Bernardo Innocenti wrote:
> Richard Henderson wrote:
> >I would think you'd have two goals in designing a stack
> >frame layout for 68k. (1) preserve the historical
> >fp_n = *(fp_(n+1)) style linkage, to allow historical
> >stack walking code to continue to work, and (2a) minimize
> >number of instructions (2b) minimize instruction size.
> >
> >I'd think you'd have only two cases there:
> >
> > frame_pointer_needed:
> >
> > link %fp,-(frame_size + saved_regs_size)
> > movem (mask-without-fp), -saved_regs_size(%fp)
> >
> > I guess on coldfire you have to compute that offset
> > into a call-clobbered address register first.
> >
> > !frame_pointer_needed:
> >
> > suba (frame_size + saved_regs_size), %sp
> > movem (%sp), (mask-with-a6-if-needed)
Is %a6 %fp here?
> > I also guess you might need to offset %sp by
> > current_function_pretend_args_size or something,
> > but I'd expect that to be zero most of the time.
>
> I think we'd still have an additional case where m68k and
> ColdFire would differ: when frame_size is zero, m68k targets
> don't need to pre-decrement SP because they can let movem do
> it as a side-effect of the post-increment.
AFAICT, merging frame_size and saved_regs_size is only possible if
frame_size is > 8 and its < (32k - saved_regs_size). Only then there
is no space difference for !frame_pointer_needed. I haven't looked
at the FP case yet.
Gunther