This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch for irix .globl directives
- From: Roger Sayle <roger at eyesopen dot com>
- To: Richard Sandiford <rsandifo at redhat dot com>, Eric Christopher <echristo at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 2 Dec 2003 19:38:40 -0700 (MST)
- Subject: Re: Patch for irix .globl directives
> * config/mips/mips.c (mips_output_external): Replace checks for
> specific builtin-in functions with a check for DECL_BUILTIN_IN.
I'm not sure that this is correct. I suspect that in addition to the
test for DECL_BUILT_IN, you also need the equivalent of builtin.c's
CALLED_AS_BUILT_IN. This is because both "sqrt" and "__builtin_sqrt"
are marked as builtins, but you want to output the external for sqrt.
In fact, we probably want to emit an external for "sqrt" in both cases,
checking DECL_ASSEMBLER_NAME_SET_P, which will be false for built-ins
that don't have a library presence, and the name of the library routine
to call otherwise.
I also think we should move that logic into the machine independent
parts of the code, rather than bury in ASM_OUTPUT_EXTERNAL. Indeed,
IRIX isn't the only affected platform, for example, PA/HP-UX with the
native linker generates the following in its assembler output:
.IMPORT __builtin_constant_p,CODE
Fortunately, the appears to be harmless but it does FAIL a few of
gcc.dg's checks that __builtin_foo shouldn't appear in the assembly
language output. builtins-1.c?
What do you think?
Roger
--