This is the mail archive of the
mailing list for the GCC project.
Re: RFA: Fix builtins/string-asm.c failures for __USER_LABEL_PREFIX__ != "" (Was: static-after-extern tests vs. mips explicit relocs)
- From: Joern Rennecke <joern dot rennecke at superh dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Richard Sandiford <rsandifo at redhat dot com>, Janis Johnson <janis187 at us dot ibm dot com>, "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>, aoliva at redhat dot com, gcc at gcc dot gnu dot org
- Date: Thu, 15 May 2003 16:06:28 +0100
- Subject: Re: RFA: Fix builtins/string-asm.c failures for __USER_LABEL_PREFIX__ != "" (Was: static-after-extern tests vs. mips explicit relocs)
- Organization: SuperH UK Ltd.
- References: <3EC29CBA.D2FB7474@superh.com> <20030514221043.GA9567@redhat.com>
Richard Henderson wrote:
> On Wed, May 14, 2003 at 08:44:58PM +0100, Joern Rennecke wrote:
> > gcc:
> > * c-decl.c (finish_decl): When setting the DECL_ASSEMBLER_NAME
> > of a function using ASMSPEC, prepend a star.
> I suspect we need a similar change somewhere in the C++ front end.
The C++ front end does not implement changing the assembler name in
cp/decl.c:cp_finish_decl calls cp/decl.c:make_rtl_for_nonlocal_decl.
cp/decl.c:make_rtl_for_nonlocal_decl gives variables the raw asmspec
(i.e. they are missing the star to protect them from munging by
assemble_name), then it calls toplev.c:rest_of_decl_compilation or
varasm.c:make_decl_rtl; toplev.c:rest_of_decl_compilation calls
varasm.c:make_decl_rtl, which in turn interprets an already set
DECL_RTL as indication that we are processing a redeclaration, and will
then ignore asmspec.
For functions and other non-variable declarations,
cp/decl.c:make_rtl_for_nonlocal_decl calls rest_of_decl_compilation,
so that varasm.c:make_decl_rtl will use the asmspec if this is the
first definition, but not if it is a redefinition.
AFAICS there is no code involved that would handle changing the
DECL_RTL of builtin functions.
So the first question is, is GNU C++ / Fortran etc supposed to change the
asm name of builtin functions when you change the asm name of their common
name? I.e. the C / OBJC frontend changes the asm name of __builtin_memcpy,
which is also used for block moves, if you change the asm name for memcpy.
Should other front ends do the same? If so, we shoud probably put that
handling of builtins into common code.
Also, should we change varasm.c:make_decl_rtl to use the asmspec even if
there is a pre-existing DECL_RTL, if the asmspec will change the name?
If we do that and also put handling for changing of the DECL_RTL of builtin
functions therem we can just call it from c-decl.c:make_decl_rtl to handle
Otherwise, we'll be able to and have to decide on and code the handling
of this extension in every frontend on a case-by-case basis.
SuperH (UK) Ltd.
2410 Aztec West / Almondsbury / BRISTOL / BS32 4QX
T:+44 1454 465658