This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: changing "configure" to default to "gcc -g -O2 -fwrapv ..."
- From: Ian Lance Taylor <iant at google dot com>
- To: Paul Eggert <eggert at CS dot UCLA dot EDU>
- Cc: autoconf-patches at gnu dot org, bug-gnulib at gnu dot org, gcc at gcc dot gnu dot org, dnovillo at redhat dot com
- Date: 29 Dec 2006 07:55:59 -0800
- Subject: Re: changing "configure" to default to "gcc -g -O2 -fwrapv ..."
- References: <87fybbyq27.fsf@penguin.cs.ucla.edu> <20061220123349.GE7947@iam.uni-bonn.de> <emc3jc$eap$1@sea.gmane.org> <87mz57xjlf.fsf@penguin.cs.ucla.edu>
Paul Eggert <eggert@CS.UCLA.EDU> writes:
> * NEWS: AC_PROG_CC, AC_PROG_CXX, and AC_PROG_OBJC now take an
> optional second argument specifying the default optimization
> options for GCC. These optimizations now default to "-O2 -fwrapv"
> instead of to "-O2". This partly attacks the problem reported by
> Ralf Wildenhues in
> <http://lists.gnu.org/archive/html/bug-gnulib/2006-12/msg00084.html>
> and in <http://gcc.gnu.org/ml/gcc/2006-12/msg00459.html>.
I fully appreciate that there is a real problem here which needs to be
addressed, but this does not seem like the best solution to me. A
great number of C programs are built using autoconf. If we make this
change, then they will all be built with -fwrapv. That will disable
useful loop optimizations, optimizations which are enabled by default
by gcc's competitors. The result will be to make gcc look worse than
it is.
You will recall that the problem with the original code was not in the
loop optimizers; it was in VRP. I think we would be better served by
changing VRP to not rely on undefined signed overflow. Or, at least,
to not rely on it without some additional option.
If we make that change on the 4.2 branch and on mainline, then no
autoconf change is necessary, and the default gcc behaviour will be
less confusing.
Does anybody think that Paul's proposed patch to autoconf would be
better than changing VRP?
Ian