From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 70656 invoked by alias); 11 Feb 2020 15:23:13 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 70635 invoked by uid 89); 11 Feb 2020 15:23:12 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-16.0 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_NUMSUBJECT autolearn=ham version=3.3.1 spammy=HContent-Transfer-Encoding:8bit X-HELO: troutmask.apl.washington.edu Received: from troutmask.apl.washington.edu (HELO troutmask.apl.washington.edu) (128.95.76.21) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 11 Feb 2020 15:23:11 +0000 Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) by troutmask.apl.washington.edu (8.15.2/8.15.2) with ESMTPS id 01BFN5gV077739 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 11 Feb 2020 07:23:06 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.15.2/8.15.2/Submit) id 01BFN5d8077738; Tue, 11 Feb 2020 07:23:05 -0800 (PST) (envelope-from sgk) Date: Tue, 11 Feb 2020 15:23:00 -0000 From: Steve Kargl To: Mark Eggleston Cc: gcc-patches , fortran Subject: Re: [PATCH] fortran: ICE using undeclared symbol in array constructor, PR93484 Message-ID: <20200211152305.GB77655@troutmask.apl.washington.edu> Reply-To: sgk@troutmask.apl.washington.edu References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-SW-Source: 2020-02/txt/msg00654.txt.bz2 On Tue, Feb 11, 2020 at 12:10:41PM +0000, Mark Eggleston wrote: > Please find attached a patch for PR93484.  The original author is Steve > Kargl. I have added the test cases. > > OK for master? I obviously think the patch is ok, but I'll let someone else review it. >     Steven G. Kargl  > >     PR fortran/93484 >     * match.c (gfc_match_type_spec): Replace gfc_match_init_expr with >     gfc_match_expr. Return m if m is MATCH_NO or MATCH_ERROR. > > diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c > index a74cb8c5c19..03adfca9bd9 100644 > --- a/gcc/fortran/match.c > +++ b/gcc/fortran/match.c > @@ -2222,9 +2222,9 @@ gfc_match_type_spec (gfc_typespec *ts) > > found: > > - m = gfc_match_init_expr (&e); > + m = gfc_match_expr (&e); > if (m == MATCH_NO || m == MATCH_ERROR) > - return MATCH_NO; > + return m; Might need gfc_reduce_init_expr (e); here. The kind type parameter should be a constant expression. > /* If a comma appears, it is an intrinsic subprogram. */ > gfc_gobble_whitespace ();