ASM_OUTPUT_EXTERNAL called for __builtin_ function

Anders Ådland aaadland@atmel.no
Thu Aug 28 19:43:00 GMT 2003


After preprocessing, the gcc.c-torture/execute/921007-1.c test program 
looks like this:
-------------
static int strcmp(){return-1;}

main()
{
if(__builtin_strcmp("X","X\376")>=0)abort();
exit(0);
}
-------------
Why is "strcmp" sent to ASM_OUTPUT_EXTERNAL(), it is builtin and never 
called? This is only done if the static version of strcmp is declared. Is 
this a bug in my port, or is this normal for all targets? (It is probably a 
bug, and the test program is written to find it...)

In my port, calling ASM_OUTPUT_EXTERNAL() means printing "extern <symbol>". 
But because "strcmp" is already used for the static function, I'm getting 
an assembler error. How do I solve this?

Anders



More information about the Gcc mailing list