From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32536 invoked by alias); 20 Dec 2011 13:43:02 -0000 Received: (qmail 32524 invoked by uid 22791); 20 Dec 2011 13:43:01 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 20 Dec 2011 13:42:49 +0000 From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/51637] New: Add compile-time error if array is too large Date: Tue, 20 Dec 2011 13:50: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: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: burnus at gcc dot gnu.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 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: 2011-12/txt/msg02261.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51637 Bug #: 51637 Summary: Add compile-time error if array is too large Classification: Unclassified Product: gcc Version: 4.7.0 Status: UNCONFIRMED Keywords: diagnostic Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned@gcc.gnu.org ReportedBy: burnus@gcc.gnu.org The following program compiles and produces the dump on x86-64-linux: struct t a[-1]; a[-9223372036854775808] = t.0; and with -m32 struct t a[-1]; a[0] = t.0; Expected: An error is printed such as ftn-951 crayftn: ERROR MAIN, File = rc1.f90, Line = 4, Column = 79 The extent for dimension 1 is too large for array "A". TYPE T END TYPE T TYPE(T), DIMENSION(-9223372036854775807_8: 9223372036854775807_8) :: A a(1) = t() end Motivated by the discussion starting at http://j3-fortran.org/pipermail/interop-tr/2011-December/000942.html / Example taken from http://j3-fortran.org/pipermail/interop-tr/2011-December/000964.html