[Patch, fortran] PR34438 - gfortran not compliant w.r.t default initialization of derived type component and implicit SAVE attribute

Dominique Dhumieres dominiq@lps.ens.fr
Mon Dec 17 21:05:00 GMT 2007


> Why would somebody write something as awful as

Not me!-) but some people collects butterflies and I collect
junk fortran codelets.

More seriously I did not try to reduce the test to something
simpler (and less ugly), but the problem seems related to
ENTRY. The following variant:

MODULE M1
 TYPE T1
  INTEGER :: i=7
 END TYPE T1
CONTAINS
 FUNCTION F1(d1) RESULT(res)
  INTEGER :: res
  TYPE(T1), INTENT(OUT) :: d1
  res=d1%i
  d1%i=0
 END FUNCTION F1
 FUNCTION E1(d1) RESULT(res)
  INTEGER :: res
  TYPE(T1), INTENT(INOUT) :: d1
  res=d1%i
  d1%i=0
 END FUNCTION E1
END MODULE M1
USE M1
TYPE(T1) :: D1
D1=T1(3)
write(6,*) F1(D1)
D1=T1(3)
write(6,*) E1(D1)
END

gives

           7
           3

Dominique



More information about the Gcc-patches mailing list