From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 883 invoked by alias); 16 Apr 2010 18:26:15 -0000 Received: (qmail 32611 invoked by uid 48); 16 Apr 2010 18:25:44 -0000 Date: Fri, 16 Apr 2010 18:26:00 -0000 Message-ID: <20100416182544.32610.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/31538] misleading bounds check error In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "kargl at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-04/txt/msg01601.txt.bz2 ------- 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