From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19764 invoked by alias); 19 Dec 2011 11:40:17 -0000 Received: (qmail 19744 invoked by uid 22791); 19 Dec 2011 11:40:15 -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 11:39:58 +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 11:52: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/msg02093.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51605 --- Comment #8 from Tobias Burnus 2011-12-19 11:39:55 UTC --- Created attachment 26139 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26139 Draft patch (for the rejects-valid part, not for the ICE) Draft patch, which allows again ptr => associate-name It also fixes an ICE ("class_ok" part, "(a)") and issues with coarrays and select type. [Coarrays now fail after resolution with an ICE.] Test cases (a) to (d): type t end type t class(t), target :: p1 ! (a) Invalid (was ICEing before) !class(t), allocatable, target :: p1 ! (b) Valid (unchanged by the patch) !class(t), allocatable :: p1 ! (c) Correctly fails (ditto) !class(t), pointer :: p1 ! (d) Valid (now accepted) class(t), pointer :: p2 select type(p1) type is(t) p2 => p1 class is(t) p2 => p1 end select end * * * Having fixed the rejects-valid issue, one again hits: internal compiler error: in gfc_trans_block_construct, at fortran/trans-stmt.c:1215 1209 ns = code->ext.block.ns; 1211 sym = ns->proc_name; 1215 gcc_assert (!sym->tlink); Here, "sym->name" is "eval_int_expr" and sym->tlink == sym. The issue is seemingly the following code in an internal procedure: integer_or_logical: select type(symbol_ptr) ... end select integer_or_logical and then another internal procedure: subroutine integer_or_logical( expr_str, flag) ... end subroutine integer_or_logical recursive subroutine eval_int_expr( int_expr, value) The label "integer_or_logical" of the block some clashes with the same-named subroutine - and thus marks the subroutine which follows somehow as EXPR_BLOCK?!?