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

            Bug ID: 94347
           Summary: Assignment pointer at declaration
           Product: gcc
           Version: 8.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rondam at yandex dot ru
  Target Milestone: ---

I am trying to compile the code:
program main
    character(10), target :: a
    character(:), pointer :: p => null()
    p => a
end program main

gfortran version 8.3.0 produces:
internal compiler error: in gfc_get_symbol_decl, at fortran/trans-decl.c:1820 
gfortran version 7.5.0 produces:
internal compiler error: in gfc_get_symbol_decl, at fortran/trans-decl.c:1777

But this:
program main
    character(10), target :: a
    character(:), pointer :: p
    p => null()
    p => a
end program main

or this:

program main
    character, dimension(10), target :: a
    character, dimension(:), pointer :: p => null()
    p => a
end program main

is compliled ok.

Reply via email to