[Bug fortran/29394] New: Invalid derived-type initialization in function

fxcoudert at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Sun Oct 8 21:36:00 GMT 2006


$ cat a11.f90           
MODULE M1 
 TYPE T1 
  INTEGER :: I=7 
 END TYPE T1 
CONTAINS 
SUBROUTINE S1(I) 
 INTEGER, INTENT(IN) :: I 
 TYPE(T1) :: D(1:I) 
 PRINT *, D(2)%I
 PRINT *, D(:)%I
 IF (D(2)%I.NE.7) CALL ABORT() 
END SUBROUTINE S1 
END MODULE M1 
USE M1 
 CALL S1(2) 
END 
$ ifort a11.f90 && ./a.out
           7
           7           7
$ gfortran -static a11.f90 && ./a.out
           0
           0           0
zsh: abort      ./a.out


-- 
           Summary: Invalid derived-type initialization in function
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: fxcoudert at gcc dot gnu dot org


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



More information about the Gcc-bugs mailing list