This is the mail archive of the
mailing list for the GCC project.
Re: changing "configure" to default to "gcc -g -O2 -fwrapv ..."
- From: "Daniel Berlin" <dberlin at dberlin dot org>
- To: bkorb at gnu dot org
- Cc: gcc at gcc dot gnu dot org, autoconf-patches at gnu dot org, bug-gnulib at gnu dot org
- Date: Sun, 31 Dec 2006 19:17:22 -0500
- Subject: Re: changing "configure" to default to "gcc -g -O2 -fwrapv ..."
- References: <200612300047.kBU0lFwk014817@localhost.localdomain> <email@example.com> <10612302258.AA24598@vlsi1.ultra.nyu.edu> <firstname.lastname@example.org> <email@example.com> <firstname.lastname@example.org> <email@example.com> <firstname.lastname@example.org> <email@example.com> <firstname.lastname@example.org>
On 12/31/06, Bruce Korb <email@example.com> wrote:
Daniel Berlin wrote:
>> Admittedly it's only two small tests, and it's with 4.1.1. But that's
>> two more tests than the -fwrapv naysayers have done, on
>> bread-and-butter applications like coreutils or gzip or Emacs (or GCC
>> itself, for that matter).
> These are not performance needing applications.
> I'll happily grant you that adding -fwrapv will make no difference at
> all on any application that does not demand performance in integer or
> floating point calculations.
It seems then that this pretty-much ought to settle it:
If the only folks that would really care are those that do performance
critical work, then 99.9% of folks not doing that kind of work should
not bear the risk of having their code break. The long standing
presumption, standardized or not, is that of wrapv semantics.
Changing that presumption without multiple years of -Wall warnings
is a Really, Really, Really Bad Idea.
I generally have no problem with turning on -fwrapv at O2, but i'm
curious where this ends.
After all, strict aliasing makes it hard to write a bunch of styles of
code people really want to write, and breaks real world programs and
Yet we decided to keep it on at O2, and off at O1.
We assume array accesses outside the defined length of an array are
invalid, but hey, maybe you really know something we don't there too.
Nothing but apps that actually do real work (and not just large
amounts of I/O) will notice these things.
Anyway, if you include "gzip" and "bzip2" in the applications that
demand performance in integer calculations, then you don't want it off
at O2. The spec scores show it makes both about 10% slower (at least).
You can distinguish the above cases all you want, but the idea that we
should trade performance for doing things we've told people for
*years* not to do, and finally made good on it, doesn't sit well with
me at all.