This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [Patch, fortran] PR34438 - gfortran not compliant w.r.t default initialization of derived type component and implicit SAVE attribute
- From: dominiq at lps dot ens dot fr (Dominique Dhumieres)
- To: fortran at gcc dot gnu dot org
- Date: Mon, 17 Dec 2007 21:35:53 +0100
- Subject: Re: [Patch, fortran] PR34438 - gfortran not compliant w.r.t default initialization of derived type component and implicit SAVE attribute
Paul,
The following test:
MODULE M1
TYPE T1
INTEGER :: i=7
END TYPE T1
CONTAINS
FUNCTION F1(d1) RESULT(res)
INTEGER :: res
TYPE(T1), INTENT(OUT) :: d1
TYPE(T1), INTENT(INOUT) :: d2
res=d1%i
d1%i=0
RETURN
ENTRY E1(d2) RESULT(res)
res=d2%i
d2%i=0
END FUNCTION F1
END MODULE M1
USE M1
TYPE(T1) :: D1
D1=T1(3)
write(6,*) F1(D1)
D1=T1(3)
write(6,*) E1(D1)
END
used to give
7
3
with your patch it segfaults as:
7
Bus error
TIA
Dominique
PS Intel Darwin9