PR bootstrap/117893 * configure.ac: Use shell loop to remove -O flags. * configure: Regenerate.
diff --git a/gcc/configure.ac b/gcc/configure.ac index e9bddc6db21..ed8d9596668 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -463,12 +463,28 @@ ACX_PROG_GDC([-I"$srcdir"/d]) # Do configure tests with the C++ compiler, since that's what we build with. AC_LANG(C++) -# Remove the -O2: for historical reasons, unless bootstrapping we prefer +# Remove all -O flags: 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 -e "s/-Ofast[[ ]]//" -e "s/-O[[gs]][[ ]]//" -e "s/[[^,]]-O[[0-9]]*[[ ]]//" ` - CXXFLAGS=`echo "$CXXFLAGS " | sed -e "s/-Ofast[[ ]]//" -e "s/-O[[gs]][[ ]]//" -e "s/[[^,]]-O[[0-9]]*[[ ]]//" ` ;; + *) + new_CFLAGS= + for flag in $CFLAGS; do + case $flag in + -O*) ;; + *) new_CFLAGS="$new_CFLAGS $flag" ;; + esac + done + CFLAGS=$new_CFLAGS + new_CXXFLAGS= + for flag in $CXXFLAGS; do + case $flag in + -O*) ;; + *) new_CXXFLAGS="$new_CXXFLAGS $flag" ;; + esac + done + CXXFLAGS=$new_CXXFLAGS + ;; esac AC_SUBST(CFLAGS) AC_SUBST(CXXFLAGS) -- 2.47.1 -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."