From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 124135 invoked by alias); 5 Jul 2019 16:03:42 -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 124120 invoked by uid 89); 5 Jul 2019 16:03:41 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-17.9 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=here's, heres, HX-Languages-Length:1869 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 05 Jul 2019 16:03:40 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=svr-ies-mbx-01.mgc.mentorg.com) by relay1.mentorg.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) id 1hjQgT-000672-Cr from Andrew_Stubbs@mentor.com ; Fri, 05 Jul 2019 09:03:37 -0700 Received: from [127.0.0.1] (137.202.0.90) by svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Fri, 5 Jul 2019 17:03:33 +0100 Subject: [committed, openmp/openacc] Tweak error message for mapped parameters To: Jakub Jelinek CC: "gcc-patches@gcc.gnu.org" , Fortran List References: <7f793719-ef9e-de39-bace-a3f07fcbe714@codesourcery.com> <20190705114951.GL815@tucnak> <72d8a84f-373e-f551-9825-25dccad4c953@codesourcery.com> <20190705121512.GN815@tucnak> <20190705140440.GP815@tucnak> <16d59874-683d-57df-a8cb-020d865f3504@codesourcery.com> <20190705144916.GQ815@tucnak> From: Andrew Stubbs Message-ID: <8e0e62b1-882e-3735-79b7-67b5149eedd7@codesourcery.com> Date: Fri, 05 Jul 2019 16:13:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <20190705144916.GQ815@tucnak> Content-Type: multipart/mixed; boundary="------------BC1676FA06AC0799DC3855B3" X-SW-Source: 2019-07/txt/msg00466.txt.bz2 --------------BC1676FA06AC0799DC3855B3 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-length: 777 On 05/07/2019 15:49, Jakub Jelinek wrote: >> OK, here is an alternative patch that merely tries to make the error message >> more informative. >> >> Basically, the user needs to get past "it isn't working but I need that >> value in this kernel", so hopefully this will help get them there. >> >> WDYT? > > I don't like it, I'd end the message where you put ;, the rest doesn't make > sense and will just confuse users. For one, the compiler should know if the > parameter needs to be copied or not, so doesn't need to talk about > probability thereof, and if it needs to be copied, it should be the compiler > that arranges that (PR90779) and the user has no way to overide or force > that behavior. Here's what Jakub approved via IRC. Now committed. Thanks Jakub Andrew --------------BC1676FA06AC0799DC3855B3 Content-Type: text/x-patch; name="190705-map-parameters-3.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="190705-map-parameters-3.patch" Content-length: 1105 Tweak error message for mapped parameters. 2019-07-05 Andrew Stubbs gcc/fortran/ * openmp.c (resolve_omp_clauses): Add custom error messages for parameters in map clauses. diff --git a/gcc/fortran/openmp.c b/gcc/fortran/openmp.c index 1c7bce6c300..44fcb9db8c6 100644 --- a/gcc/fortran/openmp.c +++ b/gcc/fortran/openmp.c @@ -4208,8 +4208,21 @@ resolve_omp_clauses (gfc_code *code, gfc_omp_clauses *omp_clauses, continue; } } - gfc_error ("Object %qs is not a variable at %L", n->sym->name, - &n->where); + if (list == OMP_LIST_MAP + && n->sym->attr.flavor == FL_PARAMETER) + { + if (openacc) + gfc_error ("Object %qs is not a variable at %L; parameters" + " cannot be and need not be copied", n->sym->name, + &n->where); + else + gfc_error ("Object %qs is not a variable at %L; parameters" + " cannot be and need not be mapped", n->sym->name, + &n->where); + } + else + gfc_error ("Object %qs is not a variable at %L", n->sym->name, + &n->where); } for (list = 0; list < OMP_LIST_NUM; list++) --------------BC1676FA06AC0799DC3855B3--