This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Questions about defaults.h ASM_FORMAT_PRIVATE_NAME
- From: Richard Henderson <rth at redhat dot com>
- To: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 4 Sep 2002 15:17:09 -0700
- Subject: Re: Questions about defaults.h ASM_FORMAT_PRIVATE_NAME
- References: <200209011644.MAA21917@caip.rutgers.edu>
On Sun, Sep 01, 2002 at 12:44:18PM -0400, Kaveh R. Ghazi wrote:
> 1. Aside from some obvious inefficiencies, I was wondering about the
> call to ASM_GENERATE_INTERNAL_LABEL. Namely why is it used?
No idea. No good reason, I suspect.
> Most
> (all?) ports define their own version which simply does this:
> sprintf (BUF, "%s.%d", NAME, NUM). I.e. without any '*' prefix.
Which should be just fine. About the only time we can't use this is
when the assembler doesn't like dots in identifiers. At which point
we can move to '$', and if that is also frowned upon, to "__%d_%s".
> 2. Given that it must return space allocated by alloca, there's no
> way to make this into a (target hook) function, right?
Well, there are exactly two users of this macro. You could change
the interface to use ggc_alloc_string instead. Especially since we
wind up doing that in both cases immediately after anyway.
r~