public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug bootstrap/63933] New: Build stage1 with -O2 during bootstrap if host compiler is a recent gcc version
@ 2014-11-18 11:57 trippels at gcc dot gnu.org
2014-11-18 12:16 ` [Bug bootstrap/63933] " pinskia at gcc dot gnu.org
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: trippels at gcc dot gnu.org @ 2014-11-18 11:57 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63933
Bug ID: 63933
Summary: Build stage1 with -O2 during bootstrap if host
compiler is a recent gcc version
Product: gcc
Version: 5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: bootstrap
Assignee: unassigned at gcc dot gnu.org
Reporter: trippels at gcc dot gnu.org
Currently gcc doesn't add any optimization level flags during stage1.
This means that stage1 is build with the default -O0 and that results
in a very slow compiler. Build times during stage2 are very high
because of this.
One solution would be to detect the host compiler and if it is a
recent (maintained?) version of gcc, then build stage1 with -O2.
I did some rough measurements on gcc112:
With:
../gcc/configure --disable-libstdcxx-pch --disable-libvtv --disable-libitm
--disable-libcilkrts --disable-libssp --disable-libgomp --disable-werror
--disable-multilib --enable-languages=c,c++,fortran
I get for the current default:
make -j160 28473.74s user 481.93s system 2067% cpu 23:20.53 total
Adding -O2 during stage1 almost halves the bootstrap time:
make -j160 15233.80s user 446.17s system 1918% cpu 13:37.25 total
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug bootstrap/63933] Build stage1 with -O2 during bootstrap if host compiler is a recent gcc version
2014-11-18 11:57 [Bug bootstrap/63933] New: Build stage1 with -O2 during bootstrap if host compiler is a recent gcc version trippels at gcc dot gnu.org
@ 2014-11-18 12:16 ` pinskia at gcc dot gnu.org
2014-11-18 12:19 ` rguenth at gcc dot gnu.org
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2014-11-18 12:16 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63933
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |WONTFIX
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
This is on purpose and how do we not know if the original compiler does not
miscompile stage1 at -O2 until it is too late. Closing as won't fix.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug bootstrap/63933] Build stage1 with -O2 during bootstrap if host compiler is a recent gcc version
2014-11-18 11:57 [Bug bootstrap/63933] New: Build stage1 with -O2 during bootstrap if host compiler is a recent gcc version trippels at gcc dot gnu.org
2014-11-18 12:16 ` [Bug bootstrap/63933] " pinskia at gcc dot gnu.org
@ 2014-11-18 12:19 ` rguenth at gcc dot gnu.org
2014-11-18 12:20 ` rguenth at gcc dot gnu.org
2014-11-18 13:49 ` andi-gcc at firstfloor dot org
3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-11-18 12:19 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63933
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Last reconfirmed| |2014-11-18
Resolution|WONTFIX |---
Ever confirmed|0 |1
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
We dont know, but we will eventually figure it out. It's a matter of
documentation to try STAGE1_CFLAGS=-g. Not that we didn't have wrong-code
bugs at -O0 ...
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug bootstrap/63933] Build stage1 with -O2 during bootstrap if host compiler is a recent gcc version
2014-11-18 11:57 [Bug bootstrap/63933] New: Build stage1 with -O2 during bootstrap if host compiler is a recent gcc version trippels at gcc dot gnu.org
2014-11-18 12:16 ` [Bug bootstrap/63933] " pinskia at gcc dot gnu.org
2014-11-18 12:19 ` rguenth at gcc dot gnu.org
@ 2014-11-18 12:20 ` rguenth at gcc dot gnu.org
2014-11-18 13:49 ` andi-gcc at firstfloor dot org
3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-11-18 12:20 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63933
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Btw, non-GCC host compilers use their default optimization setting which is
usually optimizing. We're only pessimizing our own GCC here...
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug bootstrap/63933] Build stage1 with -O2 during bootstrap if host compiler is a recent gcc version
2014-11-18 11:57 [Bug bootstrap/63933] New: Build stage1 with -O2 during bootstrap if host compiler is a recent gcc version trippels at gcc dot gnu.org
` (2 preceding siblings ...)
2014-11-18 12:20 ` rguenth at gcc dot gnu.org
@ 2014-11-18 13:49 ` andi-gcc at firstfloor dot org
3 siblings, 0 replies; 5+ messages in thread
From: andi-gcc at firstfloor dot org @ 2014-11-18 13:49 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63933
Andi Kleen <andi-gcc at firstfloor dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |andi-gcc at firstfloor dot org
--- Comment #4 from Andi Kleen <andi-gcc at firstfloor dot org> ---
Perhaps using -Og (or -O1) if available?
I actually like to use unoptimized stage1 gcc to debug things with gdb,
The last time I checked the worst offenders were some of the C++ inlines not
getting inlined, and especially the new RTL code very heavily relies on that.
Perhaps just
#define inline __attribute__((always_inline)) inline
for stage1 would be good enough to fix the worst.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-11-18 13:49 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-18 11:57 [Bug bootstrap/63933] New: Build stage1 with -O2 during bootstrap if host compiler is a recent gcc version trippels at gcc dot gnu.org
2014-11-18 12:16 ` [Bug bootstrap/63933] " pinskia at gcc dot gnu.org
2014-11-18 12:19 ` rguenth at gcc dot gnu.org
2014-11-18 12:20 ` rguenth at gcc dot gnu.org
2014-11-18 13:49 ` andi-gcc at firstfloor dot org
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).