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

Re: -flto, remove unsued code from output


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
>


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