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: Robert Dewar <dewar at adacore dot com>
- To: Robert Dewar <dewar at adacore dot com>, Richard Kenner <kenner at vlsi1 dot ultra dot nyu dot edu>, autoconf-patches at gnu dot org, bernds_cb1 at t-online dot de, bug-gnulib at gnu dot org, ebb9 at byu dot net, eggert at cs dot ucla dot edu, gcc at gcc dot gnu dot org, gdr at integrable-solutions dot net, pinskia at physics dot uc dot edu, richard dot guenther at gmail dot com
- Date: Sun, 31 Dec 2006 11:01:45 -0500
- Subject: Re: changing "configure" to default to "gcc -g -O2 -fwrapv ..."
- References: <200612310042.kBV0g5pt027400@localhost.localdomain> <45970D3D.1090700@adacore.com> <20061231120933.GS32297@ay.vinc17.org> <4597B5F0.5050504@adacore.com> <10612311408.AA19449@vlsi1.ultra.nyu.edu> <20061231144821.GW32297@ay.vinc17.org> <4597D240.90501@adacore.com> <20061231154658.GY32297@ay.vinc17.org>
Vincent Lefevre wrote:
No, this isn't what I meant. The C standard doesn't assume wrapping,
so I don't either. If the compiler doesn't either, then it can do
some optimizations. Let's take a very simple example:
We perfectly understand that if the compiler does not assume
wrapping, but instead assumes that integer overflow is undefined,
then some possible optimization opportunities open up (how could
anyone reading this thread not understand this, far better examples
have been given than the one you give here). No one is contesting
that, or failing to understand that this is of course true. So we
don't need another simple-minded tutorial on that issue!
The issues are
a) are these optimizations valuable? (and if so, in all cases,
or only in practice for loop invariants?).
b) are these optimiztions judicious? they are allowed by the
standard, but then a lot of things are allowed by the
standard that we do not take advantage of (such as fast
math), but do they cause too many surprises given actual
C coding practices.
And it is on these two points that people (rather strenuously)
disagree.