From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24783 invoked by alias); 19 Dec 2011 18:41:57 -0000 Received: (qmail 24763 invoked by uid 22791); 19 Dec 2011 18:41:55 -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; Mon, 19 Dec 2011 18:41:43 +0000 From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/51605] internal compiler error gfc_trans_block_construct, at fortran/trans-stmt.c:984 Date: Mon, 19 Dec 2011 18:56: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: rejects-valid 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: 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: 2011-12/txt/msg02149.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51605 --- Comment #12 from Tobias Burnus 2011-12-19 18:41:24 UTC --- (In reply to comment #9) > subroutine foo > BLOCK_NAME: block > end block BLOCK_NAME > end subroutine foo > subroutine BLOCK_NAME() > end subroutine BLOCK_NAME The problem is the call to "gfc_fixup_sibling_symbols" which finds in "subroutine foo" the symbol "block_name" (FL_LABEL) - and overrides it with the subroutine (FL_PROCEDURE). The source code has: > /* By 14.6.1.3, host association should be excluded > for the following. */ I think it missed F95's "(13) The name of a named construct" Patch: --- a/gcc/fortran/parse.c +++ b/gcc/fortran/parse.c @@ -3908,6 +3908,7 @@ gfc_fixup_sibling_symbols (gfc_symbol *sym, gfc_namespace *siblings) || old_sym->attr.intrinsic || old_sym->attr.generic || old_sym->attr.flavor == FL_NAMELIST + || old_sym->attr.flavor == FL_LABEL || old_sym->attr.proc == PROC_ST_FUNCTION)) { /* Replace it with the symbol from the parent namespace. */