From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23618 invoked by alias); 16 Apr 2010 16:05:28 -0000 Received: (qmail 21766 invoked by uid 48); 16 Apr 2010 16:05:06 -0000 Date: Fri, 16 Apr 2010 16:05:00 -0000 Message-ID: <20100416160506.21765.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/msg01580.txt.bz2 ------- Comment #6 from kargl at gcc dot gnu dot org 2010-04-16 16:05 ------- (In reply to comment #5) > Newly created test case. Expected: > * Extend (size) should be printed for "a = f()", as NAG f95 does > > (I'm not sure that "different shape" is correct for the current a=b message; > additionally, the A should not be capitalized and the D in different should.) > > > integer :: a(-4:1), b(0:4) > b = 5 > ! a(-4:1) = b(0:4) ! Error: different shape for Array > ! ! assignment at (1) on dimension 1 (6/5) > ! > ! gfortran: Array bound mismatch for dimension 1 of array 'f' > ! NAG f95: Rank 1 of array operand has extent 5 instead of 2 > a(i:1) = f(b) > contains > function f(x) > integer :: x(:),f(size(x)) > f = x > end function > end > The above is clearly invalid, so gfortran can go anything it wants. laptop:kargl[236] gfc4x -o z -fcheck=all g.f90 -Wuninitialized g.f90: In function 'MAIN__': g.f90:8:0: warning: 'i' may be used uninitialized in this function -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31538