From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5285 invoked by alias); 16 Dec 2018 17:42:30 -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 5255 invoked by uid 89); 16 Dec 2018 17:42:29 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-10.1 required=5.0 tests=BAYES_00,GIT_PATCH_2,GIT_PATCH_3,KAM_ASCII_DIVIDERS,KAM_LAZY_DOMAIN_SECURITY autolearn=ham version=3.3.2 spammy=UD:cl, assumed, gfc_symbol, book 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; Sun, 16 Dec 2018 17:42:27 +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 wBGHgP0j058520 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sun, 16 Dec 2018 09:42:25 -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 wBGHgP9t058519; Sun, 16 Dec 2018 09:42:25 -0800 (PST) (envelope-from sgk) Date: Sun, 16 Dec 2018 17:42:00 -0000 From: Steve Kargl To: fortran@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [PATCH] PR fortran/87992 -- trivially stupid patch, but ... Message-ID: <20181216174225.GA58470@troutmask.apl.washington.edu> Reply-To: sgk@troutmask.apl.washington.edu MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-SW-Source: 2018-12/txt/msg01179.txt.bz2 The following patch removes the ICE reported in PR fortran/87992, and restores the behavior observed with gfortran 7 and 8 (ie, code compiles). The PR marks the code with ice-on-invalid-code. I don't use CLASS in any of code and have never read the standard nor a Fortran book about CLASS. If the code is invalid, is gfortran required by a constraint to reject the code. If yes, someone with CLASS will need to address this PR; otherwise, I will commit the patch and close it as FIXED. PS: the patch simply checks for a non-NULL pointer. Index: gcc/fortran/resolve.c =================================================================== --- gcc/fortran/resolve.c (revision 267190) +++ gcc/fortran/resolve.c (working copy) @@ -12313,7 +12313,11 @@ resolve_fl_variable (gfc_symbol *sym, int mp_flag) { /* Make sure that character string variables with assumed length are dummy arguments. */ - e = sym->ts.u.cl->length; + if (sym->ts.u.cl) + e = sym->ts.u.cl->length; + else + return false; + if (e == NULL && !sym->attr.dummy && !sym->attr.result && !sym->ts.deferred && !sym->attr.select_type_temporary && !sym->attr.omp_udr_artificial_var) Index: gcc/testsuite/gfortran.dg/pr87992.f90 =================================================================== --- gcc/testsuite/gfortran.dg/pr87992.f90 (nonexistent) +++ gcc/testsuite/gfortran.dg/pr87992.f90 (working copy) @@ -0,0 +1,5 @@ +! { dg-do compile } +subroutine s(x) + class(*), allocatable :: x + x = '' +end -- Steve