This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/33780] different results between O3 and O0
- From: "jv244 at cam dot ac dot uk" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Feb 2008 11:25:55 -0000
- Subject: [Bug middle-end/33780] different results between O3 and O0
- References: <bug-33780-6642@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from jv244 at cam dot ac dot uk 2008-02-11 11:25 -------
(In reply to comment #5)
> Or are you complaining that we constant fold integer powers as if they were
> non-integer powers
Richard,
I think I'm suggesting more a enhancement than a bug fix. Some good quality
compiler like IBM's xlf90 guarantee bit-wise identical results at all
optimisation levels, unless one specifies -qno-strict (which is included by
default). My idea was/is that optimization independent results are (on the
right hardware, i.e. not x87) also provided by gcc, unless one specifies
-ffast-math. The above testcase is the only one I found in our 500kLOC
simulation package that changed results as I changed optimisation levels, so I
think it is valuable to make the underlying optimisation depending on a compile
time flag (which is included in -ffast-math).
>From a Fortran language point of view the compiler is free to use any
implementation to compute a**i, including one that varies with optimisation
level or context.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33780