Redeclaration of used symbols
Jan Hubicka
hubicka@ucw.cz
Sun Sep 7 14:42:00 GMT 2003
Hi,
We currently accept the following testcase:
t()
{
}
static int t();
b()
{
t();
}
when compiled with -fPIC we get an global symbol t that is called as if
it were local symbol in non-PIC way on i386. I believe we get similar
misscompilations on most of other targets as well as confussion of the
unit-at-a-time code and such.
Is this valid C? If so, what should be semantic in function-at-a-time
compilation?
If not, what is the best way to error about it? (check in
duplicate_decls whether entity has an initializer or is used comes into
mind)
Somewhat related and more crazy version of this in the testsuite:
extern inline int foo (void) { return 23; }
int bar (void) { return foo (); }
extern int foo (void) __attribute__ ((weak, alias ("xxx")));
int baz (void) { return foo (); }
int xxx(void) __asm__("xxx");
int xxx(void) { return 23; }
cgraphunit gets confused by finalizing extern inline function and
later missing duplicate_decls to remove DECL_SAVED_TREE of already
processed function.
What shall we do here?
Honza
More information about the Gcc
mailing list