This is the mail archive of the 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]

Redeclaration of used symbols

We currently accept the following testcase:

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

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?


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