From patchwork Sat Oct 12 04:56:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Kargl X-Patchwork-Id: 1175655 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-510824-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=troutmask.apl.washington.edu Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="St0NshaL"; 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 46qswz59b1z9s7T for ; Sat, 12 Oct 2019 15:56:32 +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:date :from:to:subject:message-id:reply-to:mime-version:content-type; q=dns; s=default; b=Ov4BusDbipF22+5rnPdkQgAR3wkzau9S2BeZxkxml2c RooGyeCrLTEuCQRG2tN9CQGZBxCnvktoQUNufBrpgYvRabxX65bg7yj8+kDDYD0z mXW8h2kPPmO9w9dW7v8q6B/asmUwslypyOQhvE6oRK7gQv36f6E+Z3tHeTnMrwoc = 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:date :from:to:subject:message-id:reply-to:mime-version:content-type; s=default; bh=T9by/i6kLV/Caj1hQKssrhiJVPw=; b=St0NshaLZunZY2hHE /e1Gt23EOqmiMppSxNyVPikKlEHeXvY6mP97P6+CpYQvQPPD11ZyGR4kSfLqdyNV xkMQ2C8+E62H1QX/r7KgsQtaQ3ZLj/6u3P2I8JzjLVFpj6ryHh2Zu3F9NCDW0wLq Vl9EG09czhKvzq3/jeMViLQ+44= Received: (qmail 58802 invoked by alias); 12 Oct 2019 04:56:19 -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 58268 invoked by uid 89); 12 Oct 2019 04:56:19 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-8.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS autolearn=ham version=3.3.1 spammy=schedules, spent 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; Sat, 12 Oct 2019 04:56:18 +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 x9C4uFCb001796 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 11 Oct 2019 21:56:16 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.15.2/8.15.2/Submit) id x9C4uFvY001795; Fri, 11 Oct 2019 21:56:15 -0700 (PDT) (envelope-from sgk) Date: Fri, 11 Oct 2019 21:56:15 -0700 From: Steve Kargl To: fortran@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [PATCH] PR fortran/91513 -- Fix poorly worded error message Message-ID: <20191012045615.GA1772@troutmask.apl.washington.edu> Reply-To: sgk@troutmask.apl.washington.edu MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.12.1 (2019-06-15) In PR fortran/91513, Damian Rouson points out that the Fortran does contain the words "impure variable". Damian and I spent an afternoon together a few weeks ago where I gave Damian a world wind view of how I see gcc/fortran and go about debugging problems. Damian and I both have full schedules, but I was hoping he would submit the patch to the list. My time of fixing gfortran bugs is running out, so ... OK to commit? 2019-09-29 Damian Rouson PR fortran/91513 * resolve.c (resolve_ordinary_assign): Improved error message. 2019-09-29 Damian Rouson PR fortran/91513 * gfortran.dg/impure_assignment_2.f90: Update dg-error regex. Index: gcc/fortran/resolve.c =================================================================== --- gcc/fortran/resolve.c (revision 276269) +++ gcc/fortran/resolve.c (working copy) @@ -10774,9 +10774,12 @@ resolve_ordinary_assign (gfc_code *code, gfc_namespace "component in a PURE procedure", &rhs->where); else - gfc_error ("The impure variable at %L is assigned to " - "a derived type variable with a POINTER " - "component in a PURE procedure (12.6)", + /* F2008, C1283 (4). */ + gfc_error ("In a pure subprogram an INTENT(IN) dummy argument " + "shall not be used as the expr at %L of an intrinsic " + "assignment statement in which the variable is of a " + "derived type if the derived type has a pointer " + "component at any level of component selection.", &rhs->where); return rval; } Index: gcc/testsuite/gfortran.dg/impure_assignment_2.f90 =================================================================== --- gcc/testsuite/gfortran.dg/impure_assignment_2.f90 (revision 276269) +++ gcc/testsuite/gfortran.dg/impure_assignment_2.f90 (working copy) @@ -40,7 +40,7 @@ CONTAINS PURE FUNCTION give_next3(node) TYPE(node_type), intent(in) :: node TYPE(node_type) :: give_next - give_next = node ! { dg-error "impure variable" } + give_next = node ! { dg-error "pure subprogram" } END FUNCTION END MODULE pr20863