> Just for the interest of discussion, I find it completely weird and
> interesting that GCC needs to build itself 3 times to fully bootstrap.
> there been any interest in looking at a single compile build?
(I know renato did not write this, but i'll just answer this here)
This is deliberate and necessary if you want to be sure.
You can do a single compile build by just "not bootstrapping".
The reason boostrapping is 3 stages is to find optimizer bugs.
stage 1: Compile new compiler
stage 2: Compile self with new compiler // IE detect any obvious bugs in
new compiler, like ICE, etc
stage 3: Compiler self with stage 2 compiler // IE detect miscompiles
caused by new compiler being broken
Stage 2 and 3 should be identical, if they aren't, you have a minimum of
non-determinism, and more likely, a codegen bug somewhere.
Otherwise, stage2 could be very broken and you may not notice, because the
compiler has relatively few compile + execute tests (since they are very
hard to write)
Instead, they rely on the one large execution test they know they can use:
the compiler itself.
Note that 3 stage bootstraps are a technique that predates gcc
> exactly know the limitations, but my naive thinking is that C++14
> source parsed by C++14 capable compiler and codegen'd to C99 (or older)
> source should make it compilable by older compilers. Is this just a
> or an actually useful idea?
Far from being an expert, my understanding is that this is largely due
to the libraries and tools.
GCC has a reduced sub-set of the compiler that works with many old
compilers, and they build that one first, then use that one to build
the required libraries, tools, and the complete compiler, than use the
complete compiler to bootstrap.
This is not correct
First stage of gcc is the entire compiler, not a subset or a different
You can also have cross-bootstrap, or