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

           Summary: Wrong result with TRANSFER from string to DT
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: bur...@gcc.gnu.org
            Blocks: 32834


The following program of James Van Buskirk prints with gfortran 4.3 to 4.6:
0000000A 0000000A 0000000A 0000000A

Expected result (as with NAG, g95, ifort):
0000000A 756E6547 49656E69 6C65746E


Found at
http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/1b907e3b7b6f3461

program test5
   use ISO_C_BINDING
   implicit none
   type, bind(C) :: CPUID_type
      integer(C_INT32_T) eax
      integer(C_INT32_T) ebx
      integer(C_INT32_T) edx
      integer(C_INT32_T) ecx
   end type CPUID_type
   type(CPUID_TYPE) result
result =
transfer(achar(10)//achar(0)//achar(0)//achar(0)//'GenuineIntel',result)
write(*,'(4(z8.8:1x))') result
end program test5

Reply via email to