This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: [m68k] asm regression with 3.3/3.4/3.5
- From: "Dave Korn" <dk at artimi dot com>
- To: <gcc at gcc dot gnu dot org>
- Cc: "'Gunther Nikl'" <gni at gecko dot de>
- Date: Thu, 13 May 2004 12:53:40 +0100
- Subject: RE: [m68k] asm regression with 3.3/3.4/3.5
[ BTW, there's a new thread on the gcc list which I've just redirected from
gcc-patches, since it covers the same problem. See the thread titled "ICE
for overlap of asm-register-declared variable and asm clobber list [H8/S
target]" ]
> -----Original Message-----
> From: Gunther Nikl [mailto:gni@gecko.de]
> 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.
> If you really think the asm() isn't useful you don't
> understand it :)
That's not what I was referring to: I was referring to the 'register ....
asm ("...")' construction aka "Explicit Reg Vars", not the inline asm
construct. Heh, I would indeed be being very dumb if I thought asm() itself
was no use.
> This asm() has inputs, outputs and clobbers. Since
> inputs/outputs are
> not allowed to overlap with clobbers all ABI scratch registers are
> outputs which for GCC means their content changes within the asm().
Ah yes, that seems like a sensible move to me.
> > I'm also curious why isn't a6 in the list of clobbers
> along with fp0/1,
> > cc and memory?
>
> Because A6 isn't changed, its not a scratch register.
Silly me, I see that now.
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? Or if a syscall calls out to another library function
just before it returns is it allowed to change a6 to point to that library
and not bother saving/restoring it?
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.
> PS: Please reply to all recipients of an original mail. Its
> no fun to only
> see a reply on the ML (to which I am not subscribed!)
It's always hard to know what to do, since different lists have different
netiquette standards and different list members have individual preferences
whether they want Cc:s or not. I default to replying onlist only because
that way I'm at least guaranteed not to intrude into someone's inbox who
didn't want me to, whereas I can always send someone an offlist Cc if they
ask. I'll try to remember your preference.
cheers,
DaveK
--
Can't think of a witty .sigline today....