From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30655 invoked by alias); 5 Apr 2013 23:12:58 -0000 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 Received: (qmail 30581 invoked by uid 48); 5 Apr 2013 23:12:52 -0000 From: "bugs at stellardeath dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/56852] New: ICE on invalid: "Bad array reference" for an undeclared loop variable Date: Fri, 05 Apr 2013 23:12:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: X-Bugzilla-Severity: minor X-Bugzilla-Who: bugs at stellardeath dot org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 X-SW-Source: 2013-04/txt/msg00512.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56852 Bug #: 56852 Summary: ICE on invalid: "Bad array reference" for an undeclared loop variable Classification: Unclassified Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: minor Priority: P3 Component: fortran AssignedTo: unassigned@gcc.gnu.org ReportedBy: bugs@stellardeath.org Created attachment 29811 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29811 Minimal testcase, invalid code, uncomment line 4 to make it valid (and compile) The following (invalid code) example produces an internal error, hit this with 4.7.2, seems to also affect my self-compiled 4.9.0 (which is used in the following transcript). The only thing remotely similar I could find is #55172, which however seems to involve OOP. If I declare "i" as integer to make the code valid, it compiles flawlessly. Here the transcript, minimal.f90 is also appended as attachment: $> cat minimal.f90 program test implicit none real :: a(4) ! integer :: i read(0) (a(i),i=1,4) end program $> gfortran minimal.f90 minimal.f90:5.14: read(0) (a(i),i=1,4) 1 Error: Symbol 'i' at (1) has no IMPLICIT type minimal.f90:1.12: program test 1 Internal Error at (1): gfc_variable_attr(): Bad array reference $> gfortran --version GNU Fortran (GCC) 4.9.0 20130405 (experimental) Copyright (C) 2013 Free Software Foundation, Inc. GNU Fortran comes with NO WARRANTY, to the extent permitted by law. You may redistribute copies of GNU Fortran under the terms of the GNU General Public License. For more information about these matters, see the file named COPYING $>