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: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Oct 2007 15:01:08 -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 #1 from rguenth at gcc dot gnu dot org 2007-10-15 15:01 -------
Confirmed. It changes for me -O2 vs. -O2 -fpeel-loops which causes the loop
in f to be completely unrolled (which at the first sight doesn't look wrong).
And we expand __powidf2 inline because the exponent is now a constant for all
calls. This indeed might explain the difference as __powidf2 is implemented
as
TYPE
NAME (TYPE x, int m)
{
unsigned int n = m < 0 ? -m : m;
TYPE y = n % 2 ? x : 1;
while (n >>= 1)
{
x = x * x;
if (n % 2)
y = y * x;
}
return m < 0 ? 1/y : y;
}
while we expand a constant integral power to an optimal (as of the count of
multiplications / additions) series of multiplications and additions.
As Fortran allows open-coding of integral powers this is not a bug. But
I'll leave final closing as INVALID to more fortran-knowing people.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2007-10-15 15:01:08
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33780