This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: How to avoid cumulative errors in building compiler?


> [Sorry about that earlier blank message.  I hit the wrong button.  Ahem.]
> 
> >From GCC v2.2.2.x I built and installed EGCS v1.1.0, then EGCS v1.1.1, now 
> EGCS v1.1.2.  Each new compiler fixed bugs that were present in the 
> previous version(s).  Now I'm wondering, am I accumulating errors?
> 
> Presumable the bugs that generated bad code in a given version also 
> generated bad code in the newer version of the compiler.

No, because you never directly use the compiler that was built by the
old compiler.  You immediately turn around and build the compiler with
itself, and then repeat the process a third time to make sure that the
results are bit-for-bit identical (except for timestamps in .o files).

What this means is that we effectively eliminate the dependency of the
final compiler binary on the original compiler binary.  So, for example
on Suns, you get the exact same gcc binary if you do a bootstrap starting
with Sun's cc, as you do if you start from some previous gcc version.

(The final binary does of course depend on what compiler flags you use).

For at least the last five years or so, no one ever published a gcc
snapshot without verifying that, on at least one platform, the compiler
passed the three-stage bootstrap test.




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]