autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: changing "configure" to default to "gcc -g -O2 -fwrapv ..."


From: Gabriel Dos Reis
Subject: Re: changing "configure" to default to "gcc -g -O2 -fwrapv ..."
Date: 29 Dec 2006 17:48:38 +0100

Ian Lance Taylor <address@hidden> writes:

| Paul Eggert <address@hidden> 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.

well, given current situation, gcc looks worse :-)

| 
| 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?

If GCC optimizers dare take existing pratice outside benchmarks into
account, then my first choice would be to make the optimizers
understand that not all "undefined behaviour" are equal, therefore
honor some existing practice (your proposal).  

If that is infeasible for GCC, then the way foward is to tell GCC
users to effectively turn on -ftrapw (Paul's proposal) so as to
compile non-benchmark programs and expect them to run as before.

-- Gaby




reply via email to

[Prev in Thread] Current Thread [Next in Thread]