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

            Bug ID: 109171
           Summary: initialization using %re causes segfault, as an
                    assignment does not
           Product: gcc
           Version: 12.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: urbanjost at comcast dot net
  Target Milestone: ---

program boom
implicit none
complex, save, target :: a(4)
#ifdef INITIALIZE
real, pointer         :: p(:) => a(1:3:2)%re
#else
real, pointer         :: p(:) 
   p => a(1:3:2)%re
#endif
   a = [(1., 0.), (2., 0.), (3., 0.), (4., 0)]
   print *, p
end program boom

when compiles with "gfortran" and so using the assignment it works; when
compiled with "gfortran -DINITIALIZE" it compiles but gets a segfault on
execution.

Reply via email to