The following patch improves bootstrap times in general, without
resorting to file splitting.  The observation that stage2 build
of gimple-match.c improves by 50% when using -fno-checking
suggests that we avoid doing redundant checking when bootstrapping
and simply disable that when using the slow stage1 compiler
(or building stage2 target libs - maybe that should include stage1
target libs as well).  Given we in the end compare stage2 and stage3
this will "only" delay checking failures plus also check whether
the IL checking affects code generation (hah).  I've resorted to
leave STAGE4 alone.

For a release checking build the overall win should be slightly
lower given the patch ends up enabling -fchecking for all target
libaries built in the final stage rather than just for those
built by the stage1 compiler (the stage1 compiler has checking
enabled for release builds as well unless manually specified).

Bootstrap with all languages enabled running on x86_64-unknown-linux-gnu.

I'll provide timings before/after the patch when they are gathered.

Any comments?  Any suggested changes (STAGE1_TFLAGS?)

Thanks,
Richard.

2018-04-25  Richard Biener  <rguent...@suse.de>

        * Makefile.tpl (STAGE2_CFLAGS): Add -fno-checking.
        (STAGE2_TFLAGS): Likewise.
        (STAGE3_CFLAGS): Add -fchecking.
        (STAGE3_TFLAGS): Likewise.
        * Makefile.in: Re-generate.

Index: Makefile.tpl
===================================================================
--- Makefile.tpl        (revision 259638)
+++ Makefile.tpl        (working copy)
@@ -452,6 +452,15 @@ STAGE1_CONFIGURE_FLAGS = --disable-inter
          --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" \
          --disable-build-format-warnings
 
+# When using the slow stage1 compiler disable IL verification and forcefully
+# enable it when using the stage2 compiler instead.  As we later compare
+# stage2 and stage3 we are merely avoid doing redundant work, plus we apply
+# checking when building all target libraries for release builds.
+STAGE2_CFLAGS += -fno-checking
+STAGE2_TFLAGS += -fno-checking
+STAGE3_CFLAGS += -fchecking
+STAGE3_TFLAGS += -fchecking
+
 STAGEprofile_CFLAGS = $(STAGE2_CFLAGS) -fprofile-generate
 STAGEprofile_TFLAGS = $(STAGE2_TFLAGS)
 
Index: Makefile.in
===================================================================
--- Makefile.in (revision 259638)
+++ Makefile.in (working copy)
@@ -529,6 +529,15 @@ STAGE1_CONFIGURE_FLAGS = --disable-inter
          --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" \
          --disable-build-format-warnings
 
+# When using the slow stage1 compiler disable IL verification and forcefully
+# enable it when using the stage2 compiler instead.  As we later compare
+# stage2 and stage3 we are merely avoid doing redundant work, plus we apply
+# checking when building all target libraries for release builds.
+STAGE2_CFLAGS += -fno-checking
+STAGE2_TFLAGS += -fno-checking
+STAGE3_CFLAGS += -fchecking
+STAGE3_TFLAGS += -fchecking
+
 STAGEprofile_CFLAGS = $(STAGE2_CFLAGS) -fprofile-generate
 STAGEprofile_TFLAGS = $(STAGE2_TFLAGS)
 

Reply via email to