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

            Bug ID: 66107
           Summary: ICE on missing parameter value for initialisation
                    (segfault)
           Product: gcc
           Version: 5.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gerhard.steinmetz.fort...@t-online.de
  Target Milestone: ---

This code snippet with a missing parameter value for n ...
   program p
      character(*), parameter :: z(2) = [character(n) :: 'x', 'y']
   end

prints (with gfortran 5.1.1 on SUSE Linux 13.2, 64 bit)
f951: internal compiler error: Segmentation fault

---

A modification of the example above ...
   program p
      integer :: n = 1   ! not a parameter
      call s
   contains
      subroutine s
         character(*), parameter :: z(2) = [character(n) :: 'x', 'y']
      end subroutine
   end

or this variation ...
   program p
      call s(1)
   contains
      subroutine s(n)
         character(*), parameter :: z(2) = [character(n) :: 'x', 'y']
      end subroutine
   end

prints, too
f951: internal compiler error: Segmentation fault

---

For example, this would be sufficient ...
   program p
      integer, parameter :: n = 1
      character(*), parameter :: z(2) = [character(n) :: 'x', 'y']
   end

Kind regards.

Reply via email to