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/69867] New: ICE on initializing character in type with array of incompatible data


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69867

            Bug ID: 69867
           Summary: ICE on initializing character in type with array of
                    incompatible data
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gerhard.steinmetz.fortran@t-online.de
  Target Milestone: ---

An array on lhs with incompatible data :

$ cat z1.f90
program p
   type t
      character(1) :: c(1) = [1]
   end type
end

$ gfortran-6 z1.f90
f951: internal compiler error: Segmentation fault



More variants :

$ cat z2.f90
program p
   type t
      character(1) :: d(1) = [1.]
      character(1) :: e(1) = [1d1]
      character(1) :: f(1) = [(0.,1.)]
      character(1) :: g(1) = [.true.]
      character(1) :: h(1) = [.false.]
      character(1) :: n(1) = [null()]
   end type
end


rhs needs not to be an array to trigger an ICE :
(incompatible ranks 0 and 1 in assignment)

$ cat z3.f90
program p
   type t
      character(1) :: c = [1]
      character(1) :: d = [1.]
      character(1) :: e = [1d1]
      character(1) :: f = [(0.,1.)]
      character(1) :: g = [.true.]
      character(1) :: h = [.false.]
      character(1) :: n = [null()]
   end type
end

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