* [lto][patch] add -flto-single to g++
@ 2008-06-23 20:56 Rafael Espindola
2008-06-23 21:11 ` Bill Maddox
2008-06-23 22:32 ` Diego Novillo
0 siblings, 2 replies; 3+ messages in thread
From: Rafael Espindola @ 2008-06-23 20:56 UTC (permalink / raw)
To: gcc-patches; +Cc: Diego Novillo, Bill Maddox
[-- Attachment #1: Type: text/plain, Size: 537 bytes --]
The attached patch adds support for using -flto-single with g++.
2008-06-23 Rafael Espindola <espindola@google.com>
* gcc.c (cc1_options): add -flto if -flto-single is given.
(default_compilers): remove redundant parts that were moved to
cc1_options.
cp/
2008-06-23 Rafael Espindola <espindola@google.com>
* lang-specs.h: add invoke_lto_single before invake_as.
Cheers,
--
Rafael Avila de Espindola
Google Ireland Ltd.
Gordon House
Barrow Street
Dublin 4
Ireland
Registered in Dublin, Ireland
Registration Number: 368047
[-- Attachment #2: cxx-lto-single.patch --]
[-- Type: application/octet-stream, Size: 2849 bytes --]
diff --git a/gcc/cp/lang-specs.h b/gcc/cp/lang-specs.h
index 54d69a1..c6e377f 100644
--- a/gcc/cp/lang-specs.h
+++ b/gcc/cp/lang-specs.h
@@ -58,10 +58,10 @@ along with GCC; see the file COPYING3. If not see
cc1plus %{save-temps|no-integrated-cpp:-fpreprocessed %{save-temps:%b.ii} %{!save-temps:%g.ii}}\
%{!save-temps:%{!no-integrated-cpp:%(cpp_unique_options)}}\
%(cc1_options) %2 %{+e1*}\
- %{!fsyntax-only:%(invoke_as)}}}}",
+ %{!fsyntax-only:%(invoke_lto_single) %(invoke_as)}}}}",
CPLUSPLUS_CPP_SPEC, 0, 0},
{".ii", "@c++-cpp-output", 0, 0, 0},
{"@c++-cpp-output",
"%{!M:%{!MM:%{!E:\
cc1plus -fpreprocessed %i %(cc1_options) %2 %{+e*}\
- %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
+ %{!fsyntax-only:%(invoke_lto_single) %(invoke_as)}}}}", 0, 0, 0},
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 525cc9e..d44e058 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -858,7 +858,7 @@ static const char *cc1_options =
%{fsyntax-only:-o %j} %{-param*}\
%{fmudflap|fmudflapth:-fno-builtin -fno-merge-constants}\
%{coverage:-fprofile-arcs -ftest-coverage}\
- %{flto:-O2} %{?lto-single(): -O2}";
+ %{flto:-O2} %{?lto-single():-O2} %{?lto-single():-flto}";
/* Do we need to preserve any assembler options here?
Note that we are going to ignore the object code, as
@@ -1033,15 +1033,15 @@ static const struct compiler default_compilers[] =
%{save-temps|traditional-cpp|no-integrated-cpp:%(trad_capable_cpp) \
%(cpp_options) -o %{save-temps:%b.i} %{!save-temps:%g.i} \n\
cc1 -fpreprocessed %{save-temps:%b.i} %{!save-temps:%g.i} \
- %{?lto-single():-flto} %(cc1_options)}\
+ %(cc1_options)}\
%{!save-temps:%{!traditional-cpp:%{!no-integrated-cpp:\
- cc1 %(cpp_unique_options) %{?lto-single():-flto} %(cc1_options)}}}\
+ cc1 %(cpp_unique_options) %(cc1_options)}}}\
%{!fsyntax-only:%(invoke_lto_single) %(invoke_as)}} \
%{combine:\
%{save-temps|traditional-cpp|no-integrated-cpp:%(trad_capable_cpp) \
%(cpp_options) -o %{save-temps:%b.i} %{!save-temps:%g.i}}\
%{!save-temps:%{!traditional-cpp:%{!no-integrated-cpp:\
- cc1 %(cpp_unique_options) %{?lto-single():-flto} %(cc1_options)}}\
+ cc1 %(cpp_unique_options) %(cc1_options)}}\
%{!fsyntax-only:%(invoke_lto_single) %(invoke_as)}}}}}}", 0, 1, 1},
{"-",
"%{!E:%e-E or -x required when input is from standard input}\
@@ -1064,7 +1064,7 @@ static const struct compiler default_compilers[] =
%W{o*:--output-pch=%*}%V}}}}}}", 0, 0, 0},
{".i", "@cpp-output", 0, 1, 0},
{"@cpp-output",
- "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %{?lto-single():-flto} %(cc1_options) \
+ "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %(cc1_options) \
%{!fsyntax-only:%(invoke_lto_single) %(invoke_as)}}}}", 0, 1, 0},
{".s", "@assembler", 0, 1, 0},
{"@assembler",
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [lto][patch] add -flto-single to g++
2008-06-23 20:56 [lto][patch] add -flto-single to g++ Rafael Espindola
@ 2008-06-23 21:11 ` Bill Maddox
2008-06-23 22:32 ` Diego Novillo
1 sibling, 0 replies; 3+ messages in thread
From: Bill Maddox @ 2008-06-23 21:11 UTC (permalink / raw)
To: Rafael Espindola; +Cc: gcc-patches, Diego Novillo
On Mon, Jun 23, 2008 at 1:46 PM, Rafael Espindola <espindola@google.com> wrote:
> The attached patch adds support for using -flto-single with g++.
>
> 2008-06-23 Rafael Espindola <espindola@google.com>
>
> * gcc.c (cc1_options): add -flto if -flto-single is given.
> (default_compilers): remove redundant parts that were moved to
> cc1_options.
>
> cp/
> 2008-06-23 Rafael Espindola <espindola@google.com>
>
> * lang-specs.h: add invoke_lto_single before invake_as.
In the change log, invake_as -> invoke_as.
You will have to wait for Diego for your formal approval, but this
looks good to me.
--Bill
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [lto][patch] add -flto-single to g++
2008-06-23 20:56 [lto][patch] add -flto-single to g++ Rafael Espindola
2008-06-23 21:11 ` Bill Maddox
@ 2008-06-23 22:32 ` Diego Novillo
1 sibling, 0 replies; 3+ messages in thread
From: Diego Novillo @ 2008-06-23 22:32 UTC (permalink / raw)
To: Rafael Espindola; +Cc: gcc-patches, Bill Maddox
On Mon, Jun 23, 2008 at 16:46, Rafael Espindola <espindola@google.com> wrote:
> 2008-06-23 Rafael Espindola <espindola@google.com>
>
> * gcc.c (cc1_options): add -flto if -flto-single is given.
> (default_compilers): remove redundant parts that were moved to
> cc1_options.
>
> cp/
> 2008-06-23 Rafael Espindola <espindola@google.com>
>
> * lang-specs.h: add invoke_lto_single before invake_as.
OK with Bill's suggestions.
Diego.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-06-23 22:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-23 20:56 [lto][patch] add -flto-single to g++ Rafael Espindola
2008-06-23 21:11 ` Bill Maddox
2008-06-23 22:32 ` Diego Novillo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).