http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49232
Summary: Pointer assignment of stride to CONTIGUOUS pointer not diagnosed as invalid Product: gcc Version: 4.7.0 Status: UNCONFIRMED Keywords: accepts-invalid, diagnostic Severity: normal Priority: P3 Component: fortran AssignedTo: unassig...@gcc.gnu.org ReportedBy: bur...@gcc.gnu.org Test case by Reinhold Bader, LRZ. Pointer assignment of a non-contiguous target to a CONTIGUOUS pointer is invalid: "If the pointer object has the CONTIGUOUS attribute, the pointer target shall be contiguous." Note: The standard does not require simply contiguous, i.e. the compiler can accept pointer targets for which it does not know whether they are contiguous. Cf. gfc_is_simply_contiguous, which, however, cannot be used directly. program cont_01_neg implicit none real, pointer, contiguous :: r(:) real, target :: x(45) integer :: i x = (/ (real(i),i=1,45) /) r => x(22::3) write(*,*) 'FAIL' end program