This is the mail archive of the
mailing list for the GCC project.
Re: [m68k] asm regression with 3.3/3.4/3.5
On Thu, May 13, 2004 at 12:53:40PM +0100, Dave Korn wrote:
> > -----Original Message-----
> > From: Gunther Nikl [mailto:email@example.com]
> > Sent: 13 May 2004 12:36
> > On Wed, May 12, 2004 at 05:04:08PM +0100, Dave Korn wrote:
> > > > -----Original Message-----
> > > > From: gcc-owner On Behalf Of Gunther Nikl
> > > > Sent: 12 May 2004 16:44
> > >
> > > > with m68k-amigaos A6 is a free register and A5 is the
> > framepointer)
> > >
> > > 'Free' ? I'd have said it was fairly seriously reserved
> > for the OS
> > > myself!
> > In GCC context A6 is a general free register since with m68k-amigaos
> > A5 is the framepointer. Most (all?) other m68k targets use A6 as
> > framepointer. For GCC it's not important to know that A6 is used for
> > system calls.
> Yeh, you're right, there's no need to place it on the list of fixed
> registers just because it's clobbered by syscalls.
Only _scratch_ registers are clobbered.
> Actually, although it's a requirement that you have the lib base pointer
> in a6 when you make a syscall, is it also guaranteed that the libcall will
> return it unmangled?
Yes, since A6 is a non-scratch register.
> In any case, I think the real issue here is that gcc isn't obliged to keep
> all those values that you've assigned to hard asm registers live during the
> asm block. It's allowed to spill and reload them if it thinks it wants to.
The documentation doesn't say anything about this. I have an explicit
register variable as _input_ of my asm(). Thus I think I can assume
that exactly this register is used.
Then it looks like there is some code out there, that exactly has this
expectation and its not m68k-only.