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

[Bug target/51643] Incorrect code produced for tail-call of weak function with -O2/-O3 option


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51643

--- Comment #6 from Alexander Osipenko <sipych at gmail dot com> 2011-12-20 23:33:06 UTC ---
It seems reasonable to expect minimal consistency, either generating invalid
(zero for example) reference for any direct weak function call, better marking
it with "warning" or even "error" message, or not depending on the optimization
options.

In any case, the semantics of weak referencies is beyond of the C standard
scope,
so even "if( wfunc ) wfunc();" may be treated only in terms of reasonable
consistency.

EABI specification follows a simple rule: "call to undefined weak function do
nothing".
Just the same do "if( wfunc ) wfunc();", a little bit longer, if we believe
that undefined wfunc == 0 always, but not 0xDEADBEEF eventually when optimized.


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