This is the mail archive of the
mailing list for the binutils project.
Re: m68k --register-prefix-optional and labels like registers
- From: Ian Lance Taylor <iant at google dot com>
- To: Nick Clifton <nickc at redhat dot com>
- Cc: Vincent RiviÃre <vincent dot riviere at freesbee dot fr>, binutils at sourceware dot org
- Date: 23 May 2007 07:34:53 -0700
- Subject: Re: m68k --register-prefix-optional and labels like registers
- References: <464DFE8F.email@example.com> <firstname.lastname@example.org>
Nick Clifton <email@example.com> writes:
> > Why is the default value of the option --register-prefix-optional is
> > not the same for all m68k targets ?
> This must be historical. The description of the
> --register-prefix-optional switch in gas/doc/c-m68k.texi mentions that
> register prefixing was needed for the sun3, amongst other targets, so
> presumably the sources evolved from this basis.
The m68k clearly requires register prefixes. Otherwise there are
ambiguities with label names. Unfortunately a large historical body
of existing assembler code and asm statements assumed that register
prefixes were not required. We could not make gas require register
prefixes without breaking that existing code. So we invented
--register-prefix-optional to permit new code to use register prefixes
without breaking old code.
New code should always use register prefixes. New code should never
use --register-prefix-optional. We were able to make that transition
for COFF: basically, we forced everybody to rewrite their assembler
code when converting from a.out to COFF, or, later, ELF. And people
could use --register-prefix-optional during the transition.
I would say that the bug here is that gas does not implement
--no-register-prefix-optional. But since register prefixes are only
optional by default for a.out, and since nobody should use a.out any
more, it's hard for me to see this as a serious problem.