gcc assembler register names

Nick Burrett nick at dsvr.net
Tue Oct 1 08:42:21 PDT 2002

Peter Naulls wrote:
> 'as' has the -gcc flag to allow register names to be defined - a1, a2,
> r0, r1 and all the rest.
> The problem is that GCC doesn't actually pass the flag (and anyway uses
> its own register names), and without these register names being defined
> (which you need to do manully if you're writing assembler), it's simply
> a bit useless.  It can also cause problems with inline assembler.
> So, I suggest that 'as' always has the register name defined.  In
> addition, if GCC wishes to stay with its __r0 format, perhaps when the
> -gcc flag is passed, those could be defined too.  Or, (radical, I know),
> gcc dumps the __ bit.

There are namespace clashes to be considered if gcc drops the `__'.

As far as I'm concerned, the -gcc option should be dropped and all code 
associated with it removed.  It is legacy code from the GCC 2.4.5 release.

Nick Burrett
Development Manager, Designer Servers Ltd.   http://www.dsvr.co.uk

More information about the gcc mailing list