From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0C0D7386F819; Wed, 6 May 2020 23:22:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0C0D7386F819 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1588807323; bh=8gYv+wSxd+4rzdlMIBOsO37GOxn3DFP0KwOwmhGSJj4=; h=From:To:Subject:Date:From; b=XSZ3IqossRTAFGTThutsfOuGpkXO/AG7mhiBrbeh31o0zQ2wAHdC6+LG+tSeI50+9 hH1qfXB1gel6IYUPBMYO+H/P+Q9jqXKM63xa6L3fZijxq92c2+R1GhgrqzCpVYDFmN HYfPCojLHLDKYiF0kJaQzPD/sf2QbYCTv3MvDoZQ= From: "foreese at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/94978] New: [8/9/10/11 Regression] Bogus warning "Array reference at (1) out of bounds in loop beginning at (2)" Date: Wed, 06 May 2020 23:22:02 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 8.4.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: foreese at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2020 23:22:03 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94978 Bug ID: 94978 Summary: [8/9/10/11 Regression] Bogus warning "Array reference at (1) out of bounds in loop beginning at (2)" Product: gcc Version: 8.4.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: foreese at gcc dot gnu.org Target Milestone: --- Created attachment 48472 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D48472&action=3Dedit Testcase which exhibits the regression The following issues a bogus warning which cannot be disabled except with -= w. The warning is not present in 7.x or earlier. Tried with 8.4.1, 9.3.1, 10 a= nd 11.x (current trunk). Attached is a simple test case, which builds Pascal's triangle of order 8 and exhibits the regression. $ gfortran pascal.f03 pascal.f03:13:25: 10 | do i =3D 0, 8 | 2=20=20=20=20=20=20=20=20=20=20=20=20=20=20 ...... 13 | pascal(i,j) =3D pascal(i-1,j) + pascal(i-1,j-1) | 1 Warning: Array reference at (1) out of bounds (-1 < 0) in loop beginning at= (2) pascal.f03:13:41: 10 | do i =3D 0, 8 | 2=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20 ...... 13 | pascal(i,j) =3D pascal(i-1,j) + pascal(i-1,j-1) | 1 Warning: Array reference at (1) out of bounds (-1 < 0) in loop beginning at= (2)=