-flto, remove unsued code from output
Richard Guenther
richard.guenther@gmail.com
Tue Dec 7 15:27:00 GMT 2010
On Tue, Dec 7, 2010 at 4:02 PM, Klaus Rudolph <lts-rudolph@gmx.de> wrote:
> Hi all,
>
> I play a bit with lto optimisation. As I see, some functions will be inlined during link stage which is the expected result. But the function code which is always inlined is not removed from the output file which will result in larger output files.
>
> Any additional option to use with gcc during compile or link?
-fwhole-program. That will make all functions (but not main) have
static linkage, so unused functions can be optimized out.
Richard.
> I am using gcc-4.5.1 for avr target on linux-x86 host.
>
> Regards
> Klaus
>
> --
> Neu: GMX De-Mail - Einfach wie E-Mail, sicher wie ein Brief!
> Jetzt De-Mail-Adresse reservieren: http://portal.gmx.net/de/go/demail
>
More information about the Gcc
mailing list