http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56423
Bug #: 56423 Summary: F08/0071: Shall reject invalid Vector subscript target with Pointer assignment Classification: Unclassified Product: gcc Version: 4.8.0 Status: UNCONFIRMED Keywords: ice-on-invalid-code Severity: normal Priority: P3 Component: fortran AssignedTo: unassig...@gcc.gnu.org ReportedBy: bur...@gcc.gnu.org Interp F08/0071, http://www.j3-fortran.org/doc/year/13/13-250.txt Note: The J3/WG5 vote is still pending. Case (4) of the test case below is invalid per clarified constraint F2008, C724: "A variable that is a pointer target shall have either the TARGET or POINTER attribute, and shall not be an array section with a vector subscript." Currently, gfortran ICEs with: internal compiler error: in gfc_conv_expr_descriptor, at fortran/trans-array.c:6589 PROGRAM m197006 REAL,TARGET :: x(100) = [ (i,i=1,100) ] REAL,POINTER :: p(:) TYPE t REAL,POINTER :: q(:) END TYPE TYPE(t) y p => x ! (1) y = t(x) ! (2) ! p => x( [ 1,4,9,25 ] ) ! (3) ! Invalid and rejected y = t(x( [ 1,4,9,25 ] )) ! (4) ! Invalid per IR F08/0071 but not rejected PRINT *,y%q END PROGRAM