From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 66035 invoked by alias); 26 Dec 2018 20:42:21 -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 66010 invoked by uid 89); 26 Dec 2018 20:42:20 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-10.9 required=5.0 tests=BAYES_00,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY autolearn=ham version=3.3.2 spammy=arrived, Hx-languages-length:1267, corrupt, expecting 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; Wed, 26 Dec 2018 20:42:19 +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 wBQKgHMA099760 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 26 Dec 2018 12:42:17 -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 wBQKgHFD099759; Wed, 26 Dec 2018 12:42:17 -0800 (PST) (envelope-from sgk) Date: Thu, 27 Dec 2018 00:57:00 -0000 From: Steve Kargl To: fortran@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [Committed] PR fortran/85407 -- convert assert to fatal error Message-ID: <20181226204217.GA99713@troutmask.apl.washington.edu> Reply-To: sgk@troutmask.apl.washington.edu MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="M9NhX3UHpAaciwkO" Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-SW-Source: 2018-12/txt/msg01689.txt.bz2 --M9NhX3UHpAaciwkO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 580 Back in April, I told Harald I would get around to committing the attached patch. Well, "around" has arrived. The patch has been tested on i586-*-freebsd and x86_64-*-freebsd. The patch converts an assert into a gfc_fatal_error(), which gives a user some information about the failure. There is no testcase as one need to go out of one's way to corrupt the components in a derived typed in a *.mod file. 2018-12-26 Harald Anlauf PR fortran/85407 * module.c (read_module): Convert assert to fatal error to give user a sensible error message. -- Steve --M9NhX3UHpAaciwkO Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="pr85407.diff" Content-length: 706 Index: gcc/fortran/module.c =================================================================== --- gcc/fortran/module.c (revision 267418) +++ gcc/fortran/module.c (working copy) @@ -5180,7 +5180,13 @@ read_module (void) if (p->u.pointer == NULL) associate_integer_pointer (p, c); mio_pool_string (&comp_name); - gcc_assert (comp_name == c->name); + if (comp_name != c->name) + { + gfc_fatal_error ("Mismatch in components of derived type " + "%qs from %qs at %C: expecting %qs, " + "but got %qs", sym->name, sym->module, + c->name, comp_name); + } skip_list (1); /* component end. */ } mio_rparen (); /* component list closing. */ --M9NhX3UHpAaciwkO--