http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54709
--- Comment #5 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-09-26
13:11:14 UTC ---
Ok, this bug won't be fixed and I'm not sure the reduced testcase handling is
a bug. With
void * memcpy (void *, void *, long);
bar ()
{
memcpy (0, 1, 1);
}
and -fvisibility=hidden the C frontend marks the memcpy builtin as having
hidden visibility (bug?). Then at LTRANS time we fail to "merge" it
with the implicit declaration of memcpy from the other TU (which didn't
get hidden visibility - bug?), so this unmerged declaration gets output
via default_elf_asm_output_external which emits (bug?)
.hidden memcpy
and the link fails.
In the TU that does not declare memcpy the memcpy is expanded inline.
With
void foo (void *p, void *q, unsigned s)
{
__builtin_memcpy (p, q, s);
}
---
void * memcpy (void *, void *, long);
void bar (void *p, void *q, unsigned s)
{
memcpy (p, q, s);
}
both calls remain (undefined, .hidden is still emitted), no warnings.