https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83416
Bug ID: 83416
Summary: [8 Regression] Invalid rejection of association of
contiguous pointer to a target
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: anlauf at gmx dot de
Target Milestone: ---
The following code gets rejected at compile time by gfortran-8 svn rev.255588:
program gfcbug141
implicit none
type t
integer, pointer, contiguous :: a(:)
end type t
integer, pointer :: x(:)
integer :: n
type(t) :: z
n = 42
allocate (x(n))
z% a => x
end program gfcbug141
% gfc-8 gfcbug141.f90
gfcbug141.f90:11:10:
z% a => x
1
Error: Assignment to contiguous pointer from non-contiguous target at (1)
I think the code is valid, and the compiler should rather insert a run-time
check whether the target is really contiguous.