From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29038 invoked by alias); 28 May 2011 10:04:19 -0000 Received: (qmail 29025 invoked by uid 22791); 28 May 2011 10:04:18 -0000 X-SWARE-Spam-Status: No, hits=-2.7 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; Sat, 28 May 2011 10:04:05 +0000 From: "janus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/49112] [4.6/4.7 Regression] [OOP] Missing type-bound procedure, "duplicate save" warnings and internal compiler error 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: major X-Bugzilla-Who: janus 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: Summary 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 Date: Sat, 28 May 2011 10:31:00 -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 X-SW-Source: 2011-05/txt/msg02805.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49112 janus at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Missing type-bound |[4.6/4.7 Regression] [OOP] |procedure, "duplicate save" |Missing type-bound |warnings and internal |procedure, "duplicate save" |compiler error |warnings and internal | |compiler error --- Comment #5 from janus at gcc dot gnu.org 2011-05-28 10:03:36 UTC --- (In reply to comment #4) > SAVE can be either a statement or an attribute. When it's statement, it > affects all the variables within the containing unit Yes, of course. I completely forgot about this possibility. Btw, the code in comment #3 works with gfortran 4.5, so it is in fact a regression. > The standard also allows the confirmation, as an attribute, of the SAVE at the > module level, so, for a "triple save" example: > > module t1_mod > save > > type :: t1 > integer :: dummy = 0 > end type > > type(t1), save :: a = t1(2), b = t1(3) > end type > > > Which also triggers a duplicate save warning. This is at best a "double save", and I think the (F08) standard forbids it: C580 (R553) If a SAVE statement with an omitted saved entity list appears in a scoping unit, no other appearance of the SAVE attr-spec or SAVE statement is permitted in that scoping unit. So I think in this case gfortran correctly complains about a "Duplicate SAVE attribute".