Cross-module inlining in gdc

Iain Buclaw ibuclaw at ubuntu.com
Wed Feb 9 13:35:06 PST 2011


== Quote from Mike Farnsworth (mike.farnsworth at gmail.com)'s article
> When doing -combine, is there a way to get gdc to feed all of the source to the
frontend all at once, such that all the definitions/bodies/etc. are all present so
that inlining can occur?  I would imagine even this strategy falls apart when
linking against a library; is there any way we can support something like -flto so
that at codegen time gcc has more opportunity to do inlining?

-combine does feed all of the source to the frontend all at once. Why it doesn't
get inlined is likely because the gcc backend consider to not do so (ie: because
code size would grow).

-flto should be supported if gcc was builtin with it enabled
(--enable-languages=lto) I've never tried it though, so that's a second guess.


More information about the D.gnu mailing list