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: eggert at CS dot UCLA dot EDU (Paul Eggert)
- Cc: dberlin at dberlin dot org (Daniel Berlin), iant at google dot com (Ian Lance Taylor), 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: Sat, 30 Dec 2006 03:01:16 -0500 (EST)
- Subject: Re: changing "configure" to default to "gcc -g -O2 -fwrapv ..."
>
> "Daniel Berlin" <dberlin@dberlin.org> writes:
>
> > Just to address the other compiler issue
> >>
> >> No, they will work on other compilers, since 'configure'
> >> won't use -O2 with those other compilers.
> >
> > icc defaults to -O2 without any options, so unless you are passing
> > -O0, it will enable this.
>
> Thanks, I didn't know that (I don't use icc).
>
> If -O0 is the only way to convince icc to give us wraparound
> arithmetic, then I guess we'll have to default to -O0 for icc.
What about XYZCC? I don't see why defaulting to -O0 for ICC will
help here at all. You are just giving up on the undefined issue instead of
fixing it in the source. I gave a way how to do this loop in a portable way
and I have not got comments back from you saying it is a good idea or not.
Since there the way you define the loop right now is not portable at all given
Daniel's comments about both ICC and XLC, I don't see why you are trying to hide
the issue.
I don't see why we are getting away from the real issue of autoconf depending on
undefined behavior code that might be miscompiled with any compiler, might not be
GCC but could any?
Here at Sony, we get reports about aliasing issues and we actually help the developers
fix their code so it is portable and works correctly. In fact recently I have been asked
about aliasing issues in code even if GCC did not create the "wrong" code yet. The developer
was able to fix his code before he even started to compile the code.
Thanks,
Andrew Pinski