This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: -flto, remove unsued code from output
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: Klaus Rudolph <lts-rudolph at gmx dot de>
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 7 Dec 2010 16:27:35 +0100
- Subject: Re: -flto, remove unsued code from output
- References: <20101207150251.81690@gmx.net>
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
>