This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/40594] [4.5 Regression] wrong-code



------- Comment #2 from janus at gcc dot gnu dot org  2009-06-30 14:28 -------
Here is a reduced and modified test case. I have marked four lines with a (*),
whose removal results in the correct output (F F), although they seem
completely unrelated. This is pretty strange stuff.


MODULE atom_types

TYPE :: atom_list
  TYPE(atom_private), DIMENSION(:), pointer :: table    ! (*) F F
END TYPE

TYPE :: atom_private
  TYPE(atom_list) :: neighbours         ! (*) F F
  LOGICAL         :: initialized = .true.
END TYPE

TYPE :: atom_model
  TYPE(atom_list) :: atoms      ! (*) F F
  integer         :: dummy
END TYPE

contains

  SUBROUTINE init(this)
    TYPE(atom_private) :: this
    this%initialized = .FALSE.
    print *, "init", this%initialized
  END SUBROUTINE

END MODULE


program pr40594

  USE atom_types
  TYPE(atom_model) :: am
  type(atom_private) :: ap

  am%dummy = 0  ! (*) F F

  call init(ap)
  print *,"main",ap%initialized

END


-- 


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]