On Thu, Sep 13, 2012 at 10:53:23AM +0200, Paolo Bonzini wrote: > Il 13/09/2012 10:46, Jakub Jelinek ha scritto: > >> > # Remove the -O2: for historical reasons, unless bootstrapping we prefer > >> > > >> > # optimizations to be activated explicitly by the toplevel. > >> > > >> > case "$CC" in > >> > */prev-gcc/xgcc*) ;; > >> > *) CFLAGS=`echo $CFLAGS | sed "s/-O[[s0-9]]* *//" ` ;; > >> > esac > >> > AC_SUBST(CFLAGS) > >> > > >> > in configure.ac does this. I think if CXXFLAGS is also so done, we'd > >> > gain parity. > > Can we get this change in? The current state is terribly annoying. > > Yes, please go ahead.
Here it is, bootstrapped/regtested on x86_64-linux and i686-linux, additionally tested on --disable-bootstrap tree, both by make cc1 inside of gcc subdir (no -O2) and make all-gcc above it (with -O2). Ok for trunk? 2012-09-13 Jakub Jelinek <ja...@redhat.com> * configure.ac (CXXFLAGS): Remove -O2 when not bootstrapping. * configure: Regenerated. --- gcc/configure.ac.jj 2012-09-13 07:54:41.000000000 +0200 +++ gcc/configure.ac 2012-09-13 14:19:54.016741197 +0200 @@ -296,9 +296,11 @@ AC_SUBST(OUTPUT_OPTION) # optimizations to be activated explicitly by the toplevel. case "$CC" in */prev-gcc/xgcc*) ;; - *) CFLAGS=`echo $CFLAGS | sed "s/-O[[s0-9]]* *//" ` ;; + *) CFLAGS=`echo $CFLAGS | sed "s/-O[[s0-9]]* *//" ` + CXXFLAGS=`echo $CXXFLAGS | sed "s/-O[[s0-9]]* *//" ` ;; esac AC_SUBST(CFLAGS) +AC_SUBST(CXXFLAGS) # Determine PICFLAG for target gnatlib. GCC_PICFLAG_FOR_TARGET --- gcc/configure.jj 2012-09-13 07:54:39.000000000 +0200 +++ gcc/configure 2012-09-13 14:34:40.429269215 +0200 @@ -4863,10 +4863,12 @@ fi # optimizations to be activated explicitly by the toplevel. case "$CC" in */prev-gcc/xgcc*) ;; - *) CFLAGS=`echo $CFLAGS | sed "s/-O[s0-9]* *//" ` ;; + *) CFLAGS=`echo $CFLAGS | sed "s/-O[s0-9]* *//" ` + CXXFLAGS=`echo $CXXFLAGS | sed "s/-O[s0-9]* *//" ` ;; esac + # Determine PICFLAG for target gnatlib. @@ -17782,7 +17784,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 17785 "configure" +#line 17787 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -17888,7 +17890,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 17891 "configure" +#line 17893 "configure" #include "confdefs.h" #if HAVE_DLFCN_H Jakub