This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Associate a name with a CODE_LABEL
- To: Michael Meissner <meissner at cygnus dot com>
- Subject: Re: [patch] Associate a name with a CODE_LABEL
- From: Richard Earnshaw <rearnsha at arm dot com>
- Date: Thu, 04 Nov 1999 19:05:02 +0000
- Cc: law at cygnus dot com, Catherine Moore <clm at cygnus dot com>, Richard Henderson <rth at cygnus dot com>, gcc-patches at gcc dot gnu dot org
- Cc: richard dot earnshaw at arm dot com
- Organization: ARM Ltd.
- Reply-To: richard dot earnshaw at arm dot com
> On Thu, Nov 04, 1999 at 04:51:24AM -0700, Jeffrey A Law wrote:
> > In message <199911041058.KAA11748@cam-mail1.cambridge.arm.com>you write:
> > >
> > > clm@cygnus.com said:
> > > + /* Provide default for ASM_OUTPUT_ALTERNATE_LABEL_NAME. */
> > > + #ifndef ASM_OUTPUT_ALTERNATE_LABEL_NAME
> > > + #define ASM_OUTPUT_ALTERNATE_LABEL_NAME(FILE,INSN) \
> > > + fprintf (FILE, "%s:\n", LABEL_ALTERNATE_NAME (INSN))
> > > + #endif
> > > +
> > >
> > > This on its own will mean that any port that does not use ':' as a label
> > > declaration will now be broken (the arm-aof port springs to mind). Would
> > > it not be better to define this in terms of some other label_generation
> > > macro (I'm not entirely sure of the intended use, but ASM_OUTPUT_LABEL
> > > might be more appropriate).
> > Agreed. FWIW, the PA is another target that does not require colons (in fact
> > if you use the HP assembler, you'll get an error if you put a colon after a
> > label. ]
>
> However since those ports don't create alternate labels, I don't see how they
> are broken. Yes, if they create alternate labels, they have to define the
> above macro.....
You miss my point.
Almost all ports have a single fundamental way of declaring a label;
normally, but not always, it is to put a colon after the label's name.
What we should really have is something like ASM_OUTPUT_LABEL_DECL(char
*label) which does this most basic operation. Then, when we add new
routines such as ASM_OUTPUT_ALTERNATE_LABEL_NAME, we can define the
default in terms of the most basic macros and stand a much better chance
of them working on all ports.
Richard.