From patchwork Tue Mar 19 22:53:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janus Weil X-Patchwork-Id: 1058749 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-498155-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gcc.gnu.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="GmzWNHyK"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44P7dR4FdFz9sNG for ; Wed, 20 Mar 2019 09:53:41 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:content-type; q= dns; s=default; b=lcuy11jB+g67wxcvj4wV/jqlWLSiDKAXzgiAUlfrZOpEmV p1L0boi4KqfhVW6sOT9NNO89wRCn1XRH0TQ0Q+7fMxwyMIltgexBl4BuSalqLi90 /30aexNlRk1V6nTnjb4ra/SfqdrdBMeptgPO6FsPUKYH9LZULxMjieu7Ofjw4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:content-type; s= default; bh=7a7Ix+dsPXdIFZuQtfBqxeCbW4U=; b=GmzWNHyKLyfIKbnYV3Nu oqM11GL3ymZMAu7O+5UXgbcWWSzpr7PPx8uP9Io8NLBo+CMPGvTG5P/+cseycCiD ZCos7ENhjnh9ygjKdjtt6C8h46mwIh6pkwJMPmN+aGV6e51KlqX7/OUU+rXhBhzH SKdcnNvr4UtUGRUQ0Ep1nMk= Received: (qmail 91452 invoked by alias); 19 Mar 2019 22:53:34 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 91437 invoked by uid 89); 19 Mar 2019 22:53:34 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-14.5 required=5.0 tests=AWL, BAYES_00, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=Gerhard, Steinmetz, gerhard, weil X-HELO: mail-oi1-f176.google.com Received: from mail-oi1-f176.google.com (HELO mail-oi1-f176.google.com) (209.85.167.176) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 19 Mar 2019 22:53:32 +0000 Received: by mail-oi1-f176.google.com with SMTP id v84so286403oif.4; Tue, 19 Mar 2019 15:53:32 -0700 (PDT) MIME-Version: 1.0 From: Janus Weil Date: Tue, 19 Mar 2019 23:53:19 +0100 Message-ID: Subject: [Patch, Fortran, F03] PR 71861: [7/8/9 Regression] ICE in write_symbol(): bad module symbol To: gfortran , gcc-patches Hi all, the attached one-line patch fixes an ICE-on-invalid regression with abstract interfaces. Regtests cleanly on x86_64-linux-gnu. Ok for trunk and the release branches (7 and 8)? Cheers, Janus diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 4dd35ec6030..cee2b2cfd15 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2019-03-19 Janus Weil + + PR fortran/71861 + * symbol.c (check_conflict): ABSTRACT attribute conflicts with + INTRINSIC attribute. + 2019-03-18 Thomas Koenig PR fortran/68009 diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c index c342d62ead1..ec753229a98 100644 --- a/gcc/fortran/symbol.c +++ b/gcc/fortran/symbol.c @@ -557,6 +557,7 @@ check_conflict (symbol_attribute *attr, const char *name, locus *where) conf (external, intrinsic); conf (entry, intrinsic); + conf (abstract, intrinsic); if ((attr->if_source == IFSRC_DECL && !attr->procedure) || attr->contained) conf (external, subroutine); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index cf01b2fea19..4649e282f64 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-03-19 Janus Weil + + PR fortran/71861 + * gfortran.dg/interface_abstract_5.f90: New test case. + 2019-03-19 Martin Sebor PR tree-optimization/89644 diff --git a/gcc/testsuite/gfortran.dg/interface_abstract_5.f90 b/gcc/testsuite/gfortran.dg/interface_abstract_5.f90 new file mode 100644 index 00000000000..fddf6b89d27 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/interface_abstract_5.f90 @@ -0,0 +1,32 @@ +! { dg-do compile } +! +! PR 71861: [7/8/9 Regression] [F03] ICE in write_symbol(): bad module symbol +! +! Contributed by Gerhard Steinmetz + +module m1 + intrinsic abs + abstract interface + function abs(x) ! { dg-error "ABSTRACT attribute conflicts with INTRINSIC attribute" } + real :: abs, x + end + end interface +end + +module m2 + abstract interface + function abs(x) + real :: abs, x + end + end interface + intrinsic abs ! { dg-error "ABSTRACT attribute conflicts with INTRINSIC attribute" } +end + +module m3 + abstract interface + function f(x) + real :: f, x + end + end interface + intrinsic f ! { dg-error "ABSTRACT attribute conflicts with INTRINSIC attribute" } +end