This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [texi, LTO]: Mention that -flto and -fwhole-program can be used simultaneously
On Tue, Oct 6, 2009 at 11:10 AM, Tobias Burnus <burnus@net-b.de> wrote:
> On 10/05/2009 07:44 PM, Diego Novillo wrote:
>> I would rather mention in the -flto entry that -flto does not imply
>> -fwhole-program. ?Something along the lines of "link time
>> optimizations do not require the presence of the whole program to
>> operate. ?If the application does not have any runtime dependencies,
>> such as shared libraries or dynamically loaded modules, it should be
>> possible to combine -flto with -fwhole-program to allow the
>> interprocedural optimizers to use more aggressive assumptions, which
>> may lead to improved optimization opportunities."
>>
>
> I copied the text but spared the "such as shared libraries or
> dynamically loaded modules". As I think it is misleading: In my
> understanding -fwhole-program causes no problem if one calls functions
> in dynamically linked libraries. The problem is only if one calls from a
> library a function in the -fwhole-program-optimized program (which is
> implicitly marked as "static" in the C sense).
>
> Is the updated patch OK?
-@option{--combine} this flag can be used to compile many smaller scale C
-programs since the functions and variables become local for the whole combined
-compilation unit, not for the single source file itself.
+@option{-combine} or @option{-flto} this flag can be used to compile many
+smaller scale programs since the functions and variables become local for the
+whole combined compilation unit, not for the single source file itself.
@option{-combine}, @option{-flto} or @option{-fwhopr}
+Link time optimizations do not require the presence of the whole
+program to operate. If the application does not have any runtime
+dependencies, it should be possible to combine @option{-flto} with
+@option{-fwhole-program} to allow the interprocedural optimizers to
+use more aggressive assumptions, which may lead to improved
+optimization opportunities.
If the program does not require any symbols to be exported, it
is possible to combine @option{-flto} and @option{-fwhopr} with
@option{-fwhole-program} to allow the interprocedural optimizers
to use more aggressive assumptions which may lead to improved
optimization opportunities.
Ok with that changes.
Richard.
> Tobias
>