This one was posted at gfortran.org

program f90_test
  implicit none
  integer :: ii8,ii4
  ii4=0
  ii8=522405223
  print'(z4)',ii4  
  print'(z12)',ii8
  print *, "z=", z'10000000'
  print *, transfer(ii8,z'10000000')
  print *, transfer(ii8,z'10000000')
  ii4=30292 !=z'7654'
  print'(z4)',ii4
  print'(z12)',ii8
end program f90_test

Repeated execution gives changing results for line 9. I have not investigated
further yet.

$ ./a.out 
   0
    1F234567
 z=            268435456
    60197368789943655
            522405223
7654
    1F234567
$ ./a.out 
   0
    1F234567
 z=            268435456
    61446413999097191
            522405223
7654
    1F234567
$ ./a.out 
   0
    1F234567
 z=            268435456
    61358453068875111
            522405223
7654
    1F234567


Jerry


-- 
           Summary: Transfer with boz constant gives wrong results
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jvdelisle at gcc dot gnu dot org
GCC target triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44489

Reply via email to