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: Ian Lance Taylor <ian at wasabisystems dot com>
- To: "Dave Korn" <dk at artimi dot com>
- Cc: <gcc at gcc dot gnu dot org>
- Date: 12 May 2004 12:37:29 -0400
- Subject: Re: [m68k] asm regression with 3.3/3.4/3.5
- References: <NUTMEGC8wSA1XvpFVjC000000ac@NUTMEG.CAM.ARTIMI.COM>
"Dave Korn" <dk@artimi.com> writes:
> > If you must use A6 for other reasons--if the subroutine expects
> > it--then you need to declare _bn to be volatile.
>
> Use of a6 to point to the base of a library is part of the amiga ABI.
> Rather than dynamically linking libraries into executables, OS syscalls are
> performed by loading the base address of a library into a6, and then calling
> through an entry in a jump table that immediately precedes the library base.
> The library is allowed to assume a6 points to it's own base address in its
> internal code, so you can't call via any of the other registers.
Ah.
It's definitely a weakness of gcc inline assembler that there is no
way to specify that a particular input must be in a particular
register.
The gcc documentation is clear about local register variables:
This option does not guarantee that GCC will generate code that
has this variable in the register you specify at all times. You
may not code an explicit reference to this register in an `asm'
statement and assume it will always refer to this variable.
If use of A6 is pervasive, then one obvious possibility is to make it
a global register variable. You'll probably still wind up with
unnecessary register motion, though.
Ian