For integer :: a(2) integer, volatile :: i i = 1 a(1:i) = a(1:2) end
The message is misleading: At line 4 of file aa.f90 Fortran runtime error: Array bound mismatch, size mismatch for dimension 1 of array 'a' (0/1) ISSUE: The size should be "1/2" and not "0/1" (For a zero-sized array the output is even "-1"). -- Summary: -fbounds-check: LHS/RHS size mismatch: Misleading error message Product: gcc Version: 4.3.0 Status: UNCONFIRMED Keywords: diagnostic Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: burnus at gcc dot gnu dot org OtherBugsDependingO 27766 nThis: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35732