From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16093 invoked by alias); 26 Feb 2010 07:54:28 -0000 Received: (qmail 15931 invoked by uid 48); 26 Feb 2010 07:54:14 -0000 Date: Fri, 26 Feb 2010 07:54:00 -0000 Message-ID: <20100226075414.15929.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/43179] ICE invalid if accessing array member of non-array In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "burnus at gcc dot gnu dot org" 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: 2010-02/txt/msg02651.txt.bz2 ------- Comment #2 from burnus at gcc dot gnu dot org 2010-02-26 07:54 ------- (In reply to comment #1) > This fixes it and regtests. > + if (array->expr_type != EXPR_VARIABLE && array->expr_type != EXPR_FUNCTION) The patch looks OK, but actually I fail to see when an EXPR_FUNCTION is valid in this case. If I try: allocate(foo()) contains function foo() integer, allocatable :: foo end function foo end gfortran already bails out with: Error: Allocate-object at (1) is not a nonprocedure pointer or an allocatable variable > OK for trunk with the usual embellishments of ChangeLogs and testcase? Yes, if you have an example for EXPR_FUNCTION - otherwise I would claim that EXPR_VARIABLE is enough. Fortran 2008 has: R631 allocation is allocate-object [ ( allocate-shape-spec-list ) ] [ lbracket allocate-coarray-spec rbracket ] R632 allocate-object is variable-name or structure-component -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43179