------- Comment #10 from kargl at gcc dot gnu dot org 2010-04-16 18:25 ------- (In reply to comment #9) > The run time error for > > i = 0 > a(i:1) = b(0:4) > > is > > At line 9 of file pr31538_db_2.f90 > Fortran runtime error: Array bound mismatch, size mismatch for dimension 1 of > array 'a' (2/5) > > for > > i = 0 > a(i:1) = f(b) > > it is > > At line 14 of file pr31538_db.f90 > Fortran runtime error: Array bound mismatch for dimension 1 of array 'f' > > In my opinion also the second case should produce an error similar to the > first > ones. >
How's this? Unpatched gfortran: laptop:kargl[205] gfc4x -o z -fcheck=bounds g.f90 laptop:kargl[206] ./z At line 9 of file g.f90 Fortran runtime error: Array bound mismatch for dimension 1 of array 'f' With a new patch: laptop:kargl[211] gfc4x -o z -fcheck=bounds g.f90 laptop:kargl[212] ./z At line 9 of file g.f90 Fortran runtime error: Dimension 1 of array 'f' has extent 5 instead of 6 laptop:kargl[213] -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31538