Hi! As discussed in the PR, during LTO bootstrap we have some hard to debug issues where different gc checking values between stage1 and stage2 result in different GC collections and occassionally we generate different code for that. The stated workaround is --enable-stage1-checking=release, I've narrowed it down to just the gc checking that should if possible for lto bootstraps match between stage1 and later checking, and --enable-checking=yes,types that we want to use by default for stage1 minus gc checking is --enable-checking=release,misc,gimple,rtlflag,tree,types
This patch arranges to do that by default, i.e. for e.g. --disable-checking --with-build-config=bootstrap-lto --with-build-config=bootstrap-lto-noplugin (the latter only on the release branches). When --enable-checking is used explicitly, gc matches between the stages, as we use then --enable-checking=$enable_checking,types and for explicit --enable-stage1-checking of course we should honor whatever the user asked for. Bootstrapped/regtested on x86_64-linux on the GCC 5 branch with --with-build-config=bootstrap-lto and tested with just running configure and inspecting config.status on both GCC 5 branch and trunk for default --with-build-config=bootstrap-lto --disable-checking --disable-checking --with-build-config=bootstrap-lto --enable-checking=release --enable-checking=release --with-build-config=bootstrap-lto --enable-checking=yes --enable-checking=yes --with-build-config=bootstrap-lto --enable-checking=misc --enable-checking=misc --with-build-config=bootstrap-lto Ok for trunk/5.1? 2015-04-17 Jakub Jelinek <ja...@redhat.com> PR bootstrap/62077 * configure.ac (--enable-stage1-checking): Default to release,misc,gimple,rtlflag,tree,types if --disable-checking or --enable-checking is not specified and DEV-PHASE is not experimental. * configure: Regenerated. --- configure.ac.jj 2015-04-12 21:48:10.891076088 +0200 +++ configure.ac 2015-04-17 13:48:00.591972993 +0200 @@ -3482,7 +3482,19 @@ AC_ARG_ENABLE(stage1-checking, [choose additional checking for stage1 of the compiler])], [stage1_checking=--enable-checking=${enable_stage1_checking}], [if test "x$enable_checking" = xno || test "x$enable_checking" = x; then - stage1_checking=--enable-checking=yes,types + # For --disable-checking or implicit --enable-checking=release, avoid + # setting --enable-checking=gc in the default stage1 checking for LTO + # bootstraps. See PR62077. + stage1_checking=--enable-checking=release,misc,gimple,rtlflag,tree,types + case $BUILD_CONFIG in + *lto*) + if test "x$enable_checking" = x && \ + test -d ${srcdir}/gcc && \ + test x"`cat ${srcdir}/gcc/DEV-PHASE`" = xexperimental; then + stage1_checking=--enable-checking=yes,types + fi;; + *) stage1_checking=--enable-checking=yes,types;; + esac else stage1_checking=--enable-checking=$enable_checking,types fi]) --- configure.jj 2015-04-12 21:48:53.000000000 +0200 +++ configure 2015-04-17 13:48:14.674745554 +0200 @@ -14761,7 +14761,19 @@ if test "${enable_stage1_checking+set}" enableval=$enable_stage1_checking; stage1_checking=--enable-checking=${enable_stage1_checking} else if test "x$enable_checking" = xno || test "x$enable_checking" = x; then - stage1_checking=--enable-checking=yes,types + # For --disable-checking or implicit --enable-checking=release, avoid + # setting --enable-checking=gc in the default stage1 checking for LTO + # bootstraps. See PR62077. + stage1_checking=--enable-checking=release,misc,gimple,rtlflag,tree,types + case $BUILD_CONFIG in + *lto*) + if test "x$enable_checking" = x && \ + test -d ${srcdir}/gcc && \ + test x"`cat ${srcdir}/gcc/DEV-PHASE`" = xexperimental; then + stage1_checking=--enable-checking=yes,types + fi;; + *) stage1_checking=--enable-checking=yes,types;; + esac else stage1_checking=--enable-checking=$enable_checking,types fi Jakub