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/67806] New: ICE on initialization of type(character) with len null


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

            Bug ID: 67806
           Summary: ICE on initialization of type(character) with len null
           Product: gcc
           Version: 5.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gerhard.steinmetz.fortran@t-online.de
  Target Milestone: ---

This code :

$ cat z1.f90
program p
   type t
      character(null()) :: c
   end type
   type(t) :: x = t('a')
end

yields :
$ gfortran -g -O0 -Wall -fcheck=all -fno-frontend-optimize z1.f90
internal compiler error: in gfc_get_derived_type, at fortran/trans-types.c:2539



Same issue for these variations :

$ cat z2.f90
program p
   type t
      character([null()]) :: c
   end type
   type(t) :: x = t('a')
end


$ cat z4.f90
program p
   integer, pointer :: n
   type t
      character(null(n)) :: c
   end type
   type(t) :: x = t('a')
end


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