public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/29410]  New: [Optimization] bug with TRANSFER() and -O2
@ 2006-10-10  9:13 dominiq at lps dot ens dot fr
  2006-10-18 20:50 ` [Bug fortran/29410] " fxcoudert at gcc dot gnu dot org
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: dominiq at lps dot ens dot fr @ 2006-10-10  9:13 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2007-01-23  5:15 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-10  9:13 [Bug fortran/29410] New: [Optimization] bug with TRANSFER() and -O2 dominiq at lps dot ens dot fr
2006-10-18 20:50 ` [Bug fortran/29410] " fxcoudert at gcc dot gnu dot org
2006-10-18 20:50 ` fxcoudert at gcc dot gnu dot org
2006-10-29 22:16 ` pinskia at gcc dot gnu dot org
2006-10-29 22:36 ` pinskia at gcc dot gnu dot org
2006-10-30 16:15 ` pinskia at gcc dot gnu dot org
2006-11-07 19:34 ` [Bug fortran/29410] [4.2 only] " pinskia at gcc dot gnu dot org
2006-11-07 19:34 ` [Bug fortran/29410] " pinskia at gcc dot gnu dot org
2006-11-07 19:35 ` pinskia at gcc dot gnu dot org
2006-11-12  1:31 ` [Bug fortran/29410] [4.2 only] " pinskia at gcc dot gnu dot org
2006-11-24 22:48 ` pinskia at gcc dot gnu dot org
2007-01-14 11:19 ` pault at gcc dot gnu dot org
2007-01-22  1:08 ` pinskia at gmail dot com
2007-01-23  5:13 ` pinskia at gcc dot gnu dot org
2007-01-23  5:15 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).