The following invalid program ------------------------------- program test_save call foo(3) contains subroutine foo(n) implicit none integer :: n real, dimension(n), save :: r ! ERROR: save and variable-dependent dim r = 1.0 write(*,*) r end subroutine foo end program test_save ------------------------------- Should emit a nice error message. However, it creates an ICE:
test.f90: In function foo: test.f90:7: internal compiler error: in gfc_trans_auto_array_allocation, at fortran/trans-array.c:3418 Please submit a full bug report, g95 does: In file test.f90:7 real, dimension(n), save :: r 1 Error: Automatic variable 'r' at (1) cannot have the SAVE attribute and ifort does: fortcom: Error: test.f90, line 7: An automatic object must not appear in a SAVE statement or be declared with the SAVE attribute. [R] real, dimension(n), save :: r ----------------------------------^ -- Summary: ICE for (invalid) save on automatic object Product: gcc Version: 4.2.0 Status: UNCONFIRMED Severity: minor Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: tobias dot burnus at physik dot fu-berlin dot de http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27583