From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20844 invoked by alias); 8 Nov 2009 23:03:21 -0000 Received: (qmail 20747 invoked by uid 22791); 8 Nov 2009 23:03:20 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from smtp-114-sunday.nerim.net (HELO maiev.nerim.net) (62.4.16.114) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 08 Nov 2009 23:03:15 +0000 Received: from hector.lesours (ours.starynkevitch.net [213.41.244.95]) by maiev.nerim.net (Postfix) with ESMTP id 23232B8460 for ; Mon, 9 Nov 2009 00:03:13 +0100 (CET) Received: from [192.168.0.1] by hector.lesours with esmtp (Exim 4.69) (envelope-from ) id 1N7GnL-0001b1-Mw for gcc@gcc.gnu.org; Mon, 09 Nov 2009 00:03:40 +0100 Message-ID: <4AF74E2A.2030703@starynkevitch.net> Date: Sun, 08 Nov 2009 23:03:00 -0000 From: Basile STARYNKEVITCH User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090701) MIME-Version: 1.0 To: GCC Mailing List Subject: is LTO aimed for large programs? Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2009-11/txt/msg00218.txt.bz2 Hello All, is gcc-trunk -flto -O2 aimed for medium sized programs (something like bash), or for bigger ones (something like the linux kernel, the Xorg server, the Qt or GTK graphical toolkit libraries, or bootstrapping GCC itself. Currently it seems that the stage3 compiler is not compiled with -flto - I suppose that would require a stage4 or perhaps even a stage5.)? I know my question is really naive, because what "large" means depend a lot. I sometimes try using gcc-trunk -flto when recompiling new stuff. The biggest software I tried so far with success is caia or malice by J.Pitrat (440KLOC of source, 10Mb binary) or ocamlrun (20?KLOC source, 212Kb binary) but I never used it yet on very big software (like the linux kernel, or GCC itself). Perhaps the question is when not to use -flto and use -fwhopr instead? Maybe we might add a hint in the *.texi documentation like; avoid using --flto on a program or library whose source size + binary size is bigger than 30% of the RAM available? [of course I don't know if the formula is good; we could try finding a better one] I have no idea if in practice the compilation time penalty of -flto -O2 is quadratic in the size of the generated binary. Regards. -- Basile STARYNKEVITCH http://starynkevitch.net/Basile/ email: basilestarynkevitchnet mobile: +33 6 8501 2359 8, rue de la Faiencerie, 92340 Bourg La Reine, France *** opinions {are only mines, sont seulement les miennes} ***