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/15365] New: Variable of derived type not initialized, unless declared with ::


% cat foo.f90

program main
  type xyz
     integer :: x = 123
  end

  type (xyz) :: a  !! ok
  type (xyz) b    !!! not initialized !!!
  print*, a%x, b%x
  if (a%x.ne.123) call abort
  if (b%x.ne.123) call abort
  print*, "ok"
end

% a.out
         123  -1073751820
Abort (core dumped)

-- 
           Summary: Variable of derived type not initialized, unless
                    declared with ::
           Product: gcc
           Version: tree-ssa
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: lei at il dot ibm dot com
                CC: gcc-bugs at gcc dot gnu dot org


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


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