This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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
--


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]