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: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: dewar at adacore dot com (Robert Dewar)
- Cc: pinskia at physics dot uc dot edu (Andrew Pinski), gdr at integrable-solutions dot net (Gabriel Dos Reis), richard dot guenther at gmail dot com (Richard Guenther), kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner), ebb9 at byu dot net, autoconf-patches at gnu dot org, bernds_cb1 at t-online dot de, bug-gnulib at gnu dot org, eggert at cs dot ucla dot edu, gcc at gcc dot gnu dot org
- Date: Sat, 30 Dec 2006 19:42:05 -0500 (EST)
- Subject: Re: changing "configure" to default to "gcc -g -O2 -fwrapv ..."
>
> Andrew Pinski wrote:
>
> >> -fwrapv-in-all-cases-except-loop-bounds
> >
> >
> > Again, please don't this the default for Fortran as integer
> > overflow has been undefined since at least 1977 so I don't think
> > it is a good idea for GCC in general anyways as evidence of Fortran.
> >
> > -- Pinski
>
> Well the question is whether the optimization buys anything
> in practice for other than the loop bound case, I am guessing
> it does not, and if that is the case there is an argument
> for uniformity.
It does buy you something for code like:
if (a - 10 < 20)
that might show up in a hot loop. So we are able to remove one extra instruction.
In fact I think this code does show up in GCC and most likely other places.
Oh and it is a very simple optimization that I added and I don't want it removed for C
or Fortran or C++ for that matter.
Thanks,
Andrew Pinski