------- Comment #2 from hubicka at gcc dot gnu dot org  2007-10-14 12:10 -------
This is result of ugly hack handling redefined extern inline functions.  The
most sane semantics (not what 3.2.x did) would be that function if inlined
should get the extern inline body, but the body from redefined non-extern
inline function should be output off-line and used when called.

Cgraph code can deal with this via cgraph->global->inline_decl.  The problem is
that frontend currently behave in a way parsing extern inline body and
finalizing it in a cgraph, but before unit is finished and cgraph has chance to
use it, the redefinition overwrite the body.

If frontend was updated to produce 2 separate declarations, one for the extern
inline body, one for the offline body and set the inline_decl of the second
declaration to point to first, things should just work.

There is one extra problem to this - extern inline functions are declared as
public and handled so by quite large part of compiler. This means that when
doing --combine (or future LTO), we end up having multiple copies of global
extern inline function and we end up not inlining them at all too.

I think frontend should be told to make those functions static (or we need to
update rest of fronend code to special case this)

Honza


-- 


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

Reply via email to