* The gcc-in-cxx branch now completes bootstrap
@ 2009-03-07 3:29 Ian Lance Taylor
2009-03-07 17:34 ` Kaveh R. GHAZI
` (3 more replies)
0 siblings, 4 replies; 16+ messages in thread
From: Ian Lance Taylor @ 2009-03-07 3:29 UTC (permalink / raw)
To: gcc
I'm happy to report that the gcc-in-cxx branch can now bootstrap. That
is, the code in gcc proper can now be compiled with a C++ compiler.
My plan going forward is as follows (when we are back in stage 1):
* For each difference between trunk and gcc-in-cxx:
+ Try to implement a -Wc++-compat warning which detects the change.
- If it is possible, implement the warning, and make the changes to
let gcc bootstrap with the warning.
- If a warning is not possible for some reason, I will simply
propose the change by itself. I expect this will be a small
subset of the changes, mostly related to the build system and to
low-level configuration like ansidecl.h.
+ This process will eventually eliminate all differences between trunk
and gcc-in-cxx, at which point gcc-in-cxx can be retired.
* Implement a configure option, --enable-c++-build or something like
that, which builds gcc with a C++ compiler.
+ Start running regular builds with that option, to avoid any
regressions in C++ buildability for cases for which there is no
-Wc++-compat warning.
* Begin the lobbying process for changing the default value of the
configure option.
I certainly welcome help on any of these steps.
Ian
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: The gcc-in-cxx branch now completes bootstrap
2009-03-07 3:29 The gcc-in-cxx branch now completes bootstrap Ian Lance Taylor
@ 2009-03-07 17:34 ` Kaveh R. GHAZI
2009-03-09 5:17 ` Ian Lance Taylor
2009-03-10 4:27 ` Ben Elliston
2009-03-07 21:12 ` Laurent GUERBY
` (2 subsequent siblings)
3 siblings, 2 replies; 16+ messages in thread
From: Kaveh R. GHAZI @ 2009-03-07 17:34 UTC (permalink / raw)
To: Ian Lance Taylor; +Cc: gcc
On Fri, 6 Mar 2009, Ian Lance Taylor wrote:
> I'm happy to report that the gcc-in-cxx branch can now bootstrap. That
> is, the code in gcc proper can now be compiled with a C++ compiler.
Great work, thanks!
I'm curious whether there are any detectable differences in the resulting
compiler when built with g++ rather than gcc. E.g. testsuite regressions,
changes in the speed or size of cc1, etc. Also, is cc1 linked with
libstdc++.so ? Stuff like that.
Would you please consider checking this?
Thanks,
--Kaveh
--
Kaveh R. Ghazi ghazi@caip.rutgers.edu
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: The gcc-in-cxx branch now completes bootstrap
2009-03-07 3:29 The gcc-in-cxx branch now completes bootstrap Ian Lance Taylor
2009-03-07 17:34 ` Kaveh R. GHAZI
@ 2009-03-07 21:12 ` Laurent GUERBY
2009-03-09 7:38 ` Ian Lance Taylor
2009-03-07 21:40 ` Gabriel Dos Reis
2009-04-17 16:39 ` Mark Mitchell
3 siblings, 1 reply; 16+ messages in thread
From: Laurent GUERBY @ 2009-03-07 21:12 UTC (permalink / raw)
To: Ian Lance Taylor; +Cc: gcc
On Fri, 2009-03-06 at 18:44 -0800, Ian Lance Taylor wrote:
> I'm happy to report that the gcc-in-cxx branch can now bootstrap. That
> is, the code in gcc proper can now be compiled with a C++ compiler.
Hi, did you test with Ada enabled? There are some C files in the
Ada compiler and RTS.
Laurent
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: The gcc-in-cxx branch now completes bootstrap
2009-03-07 3:29 The gcc-in-cxx branch now completes bootstrap Ian Lance Taylor
2009-03-07 17:34 ` Kaveh R. GHAZI
2009-03-07 21:12 ` Laurent GUERBY
@ 2009-03-07 21:40 ` Gabriel Dos Reis
2009-04-17 16:39 ` Mark Mitchell
3 siblings, 0 replies; 16+ messages in thread
From: Gabriel Dos Reis @ 2009-03-07 21:40 UTC (permalink / raw)
To: Ian Lance Taylor; +Cc: gcc
On Fri, Mar 6, 2009 at 8:44 PM, Ian Lance Taylor <iant@google.com> wrote:
> I'm happy to report that the gcc-in-cxx branch can now bootstrap. That
> is, the code in gcc proper can now be compiled with a C++ compiler.
>
> My plan going forward is as follows (when we are back in stage 1):
>
> * For each difference between trunk and gcc-in-cxx:
> + Try to implement a -Wc++-compat warning which detects the change.
> - If it is possible, implement the warning, and make the changes to
> let gcc bootstrap with the warning.
> - If a warning is not possible for some reason, I will simply
> propose the change by itself. I expect this will be a small
> subset of the changes, mostly related to the build system and to
> low-level configuration like ansidecl.h.
> + This process will eventually eliminate all differences between trunk
> and gcc-in-cxx, at which point gcc-in-cxx can be retired.
>
> * Implement a configure option, --enable-c++-build or something like
> that, which builds gcc with a C++ compiler.
> + Start running regular builds with that option, to avoid any
> regressions in C++ buildability for cases for which there is no
> -Wc++-compat warning.
>
> * Begin the lobbying process for changing the default value of the
> configure option.
>
> I certainly welcome help on any of these steps.
>
> Ian
>
Hi Ian,
This is a really fantastic job you've done.
Please send copies of your messages to my address at TAMU for
patches to implement the need -Wc++-compat so that I can review
as quickly as possible.
-- Gaby
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: The gcc-in-cxx branch now completes bootstrap
2009-03-07 17:34 ` Kaveh R. GHAZI
@ 2009-03-09 5:17 ` Ian Lance Taylor
2009-03-10 4:27 ` Ben Elliston
1 sibling, 0 replies; 16+ messages in thread
From: Ian Lance Taylor @ 2009-03-09 5:17 UTC (permalink / raw)
To: Kaveh R. GHAZI; +Cc: gcc
"Kaveh R. GHAZI" <ghazi@caip.rutgers.edu> writes:
> I'm curious whether there are any detectable differences in the resulting
> compiler when built with g++ rather than gcc. E.g. testsuite regressions,
> changes in the speed or size of cc1, etc. Also, is cc1 linked with
> libstdc++.so ? Stuff like that.
>
> Would you please consider checking this?
I haven't tested any of that stuff yet. I will at some point, or of
course anybody else can checkout gcc-in-cxx branch.
On gcc-in-cxx branch cc1 is linked with libstdc++.so.
Ian
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: The gcc-in-cxx branch now completes bootstrap
2009-03-07 21:12 ` Laurent GUERBY
@ 2009-03-09 7:38 ` Ian Lance Taylor
0 siblings, 0 replies; 16+ messages in thread
From: Ian Lance Taylor @ 2009-03-09 7:38 UTC (permalink / raw)
To: Laurent GUERBY; +Cc: gcc
Laurent GUERBY <laurent@guerby.net> writes:
> On Fri, 2009-03-06 at 18:44 -0800, Ian Lance Taylor wrote:
>> I'm happy to report that the gcc-in-cxx branch can now bootstrap. That
>> is, the code in gcc proper can now be compiled with a C++ compiler.
>
> Hi, did you test with Ada enabled? There are some C files in the
> Ada compiler and RTS.
I did not test with Ada enabled. That would have to be addressed during
the merge.
Ian
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: The gcc-in-cxx branch now completes bootstrap
2009-03-07 17:34 ` Kaveh R. GHAZI
2009-03-09 5:17 ` Ian Lance Taylor
@ 2009-03-10 4:27 ` Ben Elliston
2009-03-10 4:29 ` Ian Lance Taylor
1 sibling, 1 reply; 16+ messages in thread
From: Ben Elliston @ 2009-03-10 4:27 UTC (permalink / raw)
To: Kaveh R. GHAZI; +Cc: Ian Lance Taylor, gcc
> I'm curious whether there are any detectable differences in the resulting
> compiler when built with g++ rather than gcc. E.g. testsuite regressions,
> changes in the speed or size of cc1, etc. Also, is cc1 linked with
> libstdc++.so ? Stuff like that.
Also, is there any significant difference in bootstrap times?
Ben
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: The gcc-in-cxx branch now completes bootstrap
2009-03-10 4:27 ` Ben Elliston
@ 2009-03-10 4:29 ` Ian Lance Taylor
2009-03-10 10:56 ` Ben Elliston
2009-04-12 6:08 ` Thomas Neumann
0 siblings, 2 replies; 16+ messages in thread
From: Ian Lance Taylor @ 2009-03-10 4:29 UTC (permalink / raw)
To: Ben Elliston; +Cc: Kaveh R. GHAZI, gcc
Ben Elliston <bje@au1.ibm.com> writes:
>> I'm curious whether there are any detectable differences in the resulting
>> compiler when built with g++ rather than gcc. E.g. testsuite regressions,
>> changes in the speed or size of cc1, etc. Also, is cc1 linked with
>> libstdc++.so ? Stuff like that.
>
> Also, is there any significant difference in bootstrap times?
I haven't actually measured, but subjectively bootstrap does seem to
take longer.
I encourage anybody interested in these sorts of questions to check out
the branch and find out. gcc-in-cxx is something I do entirely in my
spare time, and it's not like I have more spare time than anybody else
does.
Ian
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: The gcc-in-cxx branch now completes bootstrap
2009-03-10 4:29 ` Ian Lance Taylor
@ 2009-03-10 10:56 ` Ben Elliston
2009-04-12 6:08 ` Thomas Neumann
1 sibling, 0 replies; 16+ messages in thread
From: Ben Elliston @ 2009-03-10 10:56 UTC (permalink / raw)
To: Ian Lance Taylor; +Cc: Kaveh R. GHAZI, gcc
On Mon, 2009-03-09 at 21:25 -0700, Ian Lance Taylor wrote:
> > Also, is there any significant difference in bootstrap times?
>
> I haven't actually measured, but subjectively bootstrap does seem to
> take longer.
A subjective assessment was all I was interested in.
Thanks,
Ben
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: The gcc-in-cxx branch now completes bootstrap
2009-03-10 4:29 ` Ian Lance Taylor
2009-03-10 10:56 ` Ben Elliston
@ 2009-04-12 6:08 ` Thomas Neumann
2009-04-12 6:59 ` Segher Boessenkool
2009-04-12 7:56 ` Ben Elliston
1 sibling, 2 replies; 16+ messages in thread
From: Thomas Neumann @ 2009-04-12 6:08 UTC (permalink / raw)
To: gcc
>> Also, is there any significant difference in bootstrap times?
>
> I haven't actually measured, but subjectively bootstrap does seem to
> take longer.
I tried this out of curiosity. The numbers below are the bootstrap times on
a 64bit 2.6.28 Linux system (Core 2 E8400), building single threaded with
--enable-languages=c,c++ --disable-multilib
Regular gcc:
real 59m6.914s
user 53m53.702s
sys 3m24.073s
gcc-in-cxx:
real 68m15.366s
user 61m32.255s
sys 4m24.481s
Of course the bootstrap times are not that useful themselves, as they
compare two quite different compilation tasks (one C, one C++). To get a
better idea about the different compiler speeds, I compiled some random
(reasonably complex) C++ code I had at hand, and compared the compile times.
Regular gcc:
real 0m30.478s
user 0m27.842s
sys 0m1.888s
gcc-in-cxx:
real 0m35.926s
user 0m34.386s
sys 0m1.208s
Again the comparison is not 100% fair ("regular gcc" is current mainline,
while the gcc-in-cxx branch is older), but apparently the C++ version is
quite a bit slower.
Admittedly gcc-in-cxx just recently managed to bootstrap at all, so perhaps
performance comparisons are a bit unfair. But I do not mean this as critique
of gcc-in-cxx, I want to help improve it and to bring it to the same speed
as regular mainline.
Is there any reasonably simple way to find out why the C++ version is
slower? I can use something like oprofile, of course, but I thought gcc can
somehow give statistics about its internal times, which might be more useful
for a first approximation.
Thomas
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: The gcc-in-cxx branch now completes bootstrap
2009-04-12 6:08 ` Thomas Neumann
@ 2009-04-12 6:59 ` Segher Boessenkool
2009-04-12 7:56 ` Ben Elliston
1 sibling, 0 replies; 16+ messages in thread
From: Segher Boessenkool @ 2009-04-12 6:59 UTC (permalink / raw)
To: Thomas Neumann; +Cc: gcc
> Is there any reasonably simple way to find out why the C++ version is
> slower? I can use something like oprofile, of course, but I thought
> gcc can
> somehow give statistics about its internal times, which might be
> more useful
> for a first approximation.
I think you're thinking about the -Q option?
Segher
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: The gcc-in-cxx branch now completes bootstrap
2009-04-12 6:08 ` Thomas Neumann
2009-04-12 6:59 ` Segher Boessenkool
@ 2009-04-12 7:56 ` Ben Elliston
2009-04-12 9:34 ` Thomas Neumann
1 sibling, 1 reply; 16+ messages in thread
From: Ben Elliston @ 2009-04-12 7:56 UTC (permalink / raw)
To: Thomas Neumann; +Cc: gcc
On Sat, 2009-04-11 at 22:37 +0200, Thomas Neumann wrote:
> Is there any reasonably simple way to find out why the C++ version is
> slower? I can use something like oprofile, of course, but I thought
> gcc can somehow give statistics about its internal times, which might
> be more useful for a first approximation.
Try using -ftime-report.
Ben
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: The gcc-in-cxx branch now completes bootstrap
2009-04-12 7:56 ` Ben Elliston
@ 2009-04-12 9:34 ` Thomas Neumann
2009-04-12 19:45 ` Thomas Neumann
0 siblings, 1 reply; 16+ messages in thread
From: Thomas Neumann @ 2009-04-12 9:34 UTC (permalink / raw)
To: gcc
Ben Elliston wrote:
> Try using -ftime-report.
thanks, that was what I had in mind.
The largest difference seems to be in "tree STMT verifier" (36% runtime
increase), a few others increased slightly, most seem to be nearly
identical. (This distribution could be an artifact of my example code, of
course).
I will have to take a closer look to find the exact cause of the slow-down.
Thomas
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: The gcc-in-cxx branch now completes bootstrap
2009-04-12 9:34 ` Thomas Neumann
@ 2009-04-12 19:45 ` Thomas Neumann
2009-04-12 22:49 ` Richard Guenther
0 siblings, 1 reply; 16+ messages in thread
From: Thomas Neumann @ 2009-04-12 19:45 UTC (permalink / raw)
To: gcc
Curious. I ran both g++ variants in oprofile, and then compared the
generated assembler code for the most critical functions.
The top 1 function in both cases is pointer_set_insert, and there the
assembler code is 100% identical (module one choice between r14 and r15).
The second most critical function in the gcc-in-cxx build is walk_tree_1,
which is only place 4 in mainline gcc.
There the code seems to be identical, too, except for code layout: The
compiler arranges the code in a different order, and apparently has
different a different branch prediction. The non-branching code is nearly
identical, too.
The "hottest" assembler instructions in walk_tree_1 are memory accesses,
apparently the mainline version causes slightly less cache misses or better
prediction? (my interpretation, not measured yet)
I am a bit unsure how to proceed. The gcc-in-cxx assembler code looks ok, as
it is nearly identical to the mainline code. The main differences are in the
code/branch layout, and I wouldn't know how to debug this.
Thomas
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: The gcc-in-cxx branch now completes bootstrap
2009-04-12 19:45 ` Thomas Neumann
@ 2009-04-12 22:49 ` Richard Guenther
0 siblings, 0 replies; 16+ messages in thread
From: Richard Guenther @ 2009-04-12 22:49 UTC (permalink / raw)
To: Thomas Neumann; +Cc: gcc
On Sun, Apr 12, 2009 at 9:56 AM, Thomas Neumann
<tneumann@users.sourceforge.net> wrote:
> Curious. I ran both g++ variants in oprofile, and then compared the
> generated assembler code for the most critical functions.
>
> The top 1 function in both cases is pointer_set_insert, and there the
> assembler code is 100% identical (module one choice between r14 and r15).
>
> The second most critical function in the gcc-in-cxx build is walk_tree_1,
> which is only place 4 in mainline gcc.
> There the code seems to be identical, too, except for code layout: The
> compiler arranges the code in a different order, and apparently has
> different a different branch prediction. The non-branching code is nearly
> identical, too.
> The "hottest" assembler instructions in walk_tree_1 are memory accesses,
> apparently the mainline version causes slightly less cache misses or better
> prediction? (my interpretation, not measured yet)
>
> I am a bit unsure how to proceed. The gcc-in-cxx assembler code looks ok, as
> it is nearly identical to the mainline code. The main differences are in the
> code/branch layout, and I wouldn't know how to debug this.
I suggest to compare against trunk at the latest merge point for
gcc-in-cxx (which was likely before the alias-improvements branch merge
which brought quite some changes in the tree verifiers and improved
compile-time overall).
Or just ask Ian to merge again from trunk ...
Richard.
> Thomas
>
>
>
>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: The gcc-in-cxx branch now completes bootstrap
2009-03-07 3:29 The gcc-in-cxx branch now completes bootstrap Ian Lance Taylor
` (2 preceding siblings ...)
2009-03-07 21:40 ` Gabriel Dos Reis
@ 2009-04-17 16:39 ` Mark Mitchell
3 siblings, 0 replies; 16+ messages in thread
From: Mark Mitchell @ 2009-04-17 16:39 UTC (permalink / raw)
To: Ian Lance Taylor; +Cc: gcc
Ian Lance Taylor wrote:
> My plan going forward is as follows (when we are back in stage 1):
FWIW, I think this is a great plan.
Thanks,
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2009-04-17 5:03 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-07 3:29 The gcc-in-cxx branch now completes bootstrap Ian Lance Taylor
2009-03-07 17:34 ` Kaveh R. GHAZI
2009-03-09 5:17 ` Ian Lance Taylor
2009-03-10 4:27 ` Ben Elliston
2009-03-10 4:29 ` Ian Lance Taylor
2009-03-10 10:56 ` Ben Elliston
2009-04-12 6:08 ` Thomas Neumann
2009-04-12 6:59 ` Segher Boessenkool
2009-04-12 7:56 ` Ben Elliston
2009-04-12 9:34 ` Thomas Neumann
2009-04-12 19:45 ` Thomas Neumann
2009-04-12 22:49 ` Richard Guenther
2009-03-07 21:12 ` Laurent GUERBY
2009-03-09 7:38 ` Ian Lance Taylor
2009-03-07 21:40 ` Gabriel Dos Reis
2009-04-17 16:39 ` Mark Mitchell
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).