This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/29410] New: [Optimization] bug with TRANSFER() and -O2
- From: "dominiq at lps dot ens dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Oct 2006 09:13:13 -0000
- Subject: [Bug fortran/29410] New: [Optimization] bug with TRANSFER() and -O2
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following code:
program chop
integer ix, iy
real x, y
x = 1.
y = x
ix = transfer(x,ix)
iy = transfer(y,iy)
print '(2z20.8)', ix, iy
if (ix /= iy) call abort
end program chop
when compiled with -O1 (or below) on PPC OSX 10.3, gives the correct result:
3F800000 3F800000
but when compiled with -O2 (or above) gives:
8FE15C3C 8FE52E41
This bug does not show up on Linux AMD64, gfortran 4.2.0 20061009.
Note 1, if I replace
real x, y
by
real o, t, x, y
or
real o, t, td, x, y
I get (with -O2) respectively:
BFFFEFA0 8FE52E41
or
8FE52E41 BFFFEFA0
Note 2, on OSX 10.4, gfortran 4.2.0 20060610, I get
00002D44 003006D0
TIA
Dominique
--
Summary: [Optimization] bug with TRANSFER() and -O2
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: dominiq at lps dot ens dot fr
GCC build triplet: 4.2.0 20061007
GCC target triplet: powerpc-apple-darwin7
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29410