From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31131 invoked by alias); 25 Apr 2012 06:47:13 -0000 Received: (qmail 31120 invoked by uid 22791); 25 Apr 2012 06:47:12 -0000 X-SWARE-Spam-Status: No, hits=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,KHOP_THREADED 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; Wed, 25 Apr 2012 06:46:59 +0000 From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/53086] [4.8 Regression] 416.gamess in SPEC CPU 2006 miscompiled Date: Wed, 25 Apr 2012 06:47:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: burnus at gcc dot gnu.org X-Bugzilla-Status: REOPENED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.8.0 X-Bugzilla-Changed-Fields: CC Message-ID: In-Reply-To: References: 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: 2012-04/txt/msg02213.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53086 Tobias Burnus changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |burnus at gcc dot gnu.org --- Comment #12 from Tobias Burnus 2012-04-25 06:46:03 UTC --- (In reply to comment #2) > In most units we have > COMMON /FMCOM / X(1) > but in unport.F > PARAMETER (MEMSIZ= 80 000 000) > COMMON /FMCOM / X(MEMSIZ) > that can't work (?) The Fortran standard requires that all named common blocks [with the same name] have the same size (which is violated here). However, in practice, several Fortran programs violate this rule. For unnamed common blocks ("common // var1, var2"), different sizes are allowed. However, accessing elements beyond the last argument - like "X(2)" for the first definition - is invalid. Thus, the -fcheck=bounds error seems to be appropriate. The question is what we do about x(2). While it is invalid, it seems to be used. As the Fortran FE knows that the last item in a given common block is an array element, it could change the middle-end decl to "[1:]". (I have not yet checked the exact wording in the Fortran 66 to 2008 standards.)