This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/29394] New: Invalid derived-type initialization in function
- From: "fxcoudert at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Oct 2006 21:36:21 -0000
- Subject: [Bug fortran/29394] New: Invalid derived-type initialization in function
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
$ 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