From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa4.mentor.iphmx.com (esa4.mentor.iphmx.com [68.232.137.252]) by sourceware.org (Postfix) with ESMTPS id 498B63851A91 for ; Mon, 13 Jun 2022 13:29:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 498B63851A91 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="5.91,297,1647331200"; d="scan'208";a="77188993" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa4.mentor.iphmx.com with ESMTP; 13 Jun 2022 05:29:51 -0800 IronPort-SDR: Y7YbCH8srr+5XeS1dfp7f1oinm/254tij9ShpQGBeb05XqxUWsoRc1A7dwkZGRUTIUVIl9N7Xx fZ4yw16JLOFLE2Oe8bkSeYWUflOO9bdwNRqwaaiMNMtN2XkGftbO4p9xl2/ZttdeaxLs174sGx JDVPr03VbU8Cd3aYLzXFiaKmG/bU1teDp5DrDcTW6iHO6qv+SwyCF7h66QEMya3L2OQbSjoerl Hq0FuCA9U/+FCEARC8QOja/BXzBy4+RcXlqZ+NlFfal/mtBh4wWlxUfThorqzIDXNPQqG8CPXZ gaA= Message-ID: <075e0483-6d7b-3bbc-a718-b0872a870f85@codesourcery.com> Date: Mon, 13 Jun 2022 21:29:34 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH, OpenMP, v4] Implement uses_allocators clause for target regions Content-Language: en-US To: Jakub Jelinek CC: Tobias Burnus , gcc-patches , Hafiz Abid Qadeer , Andrew Stubbs References: <46d77e14-080c-db6c-4032-e12899c5d059@codesourcery.com> <9c0945fa-1054-095e-86ae-a9d8dd1ab625@codesourcery.com> From: Chung-Lin Tang In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SVR-ORW-MBX-06.mgc.mentorg.com (147.34.90.206) To svr-orw-mbx-10.mgc.mentorg.com (147.34.90.210) X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, KAM_SHORT, NICE_REPLY_A, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2022 13:29:54 -0000 On 2022/6/9 8:22 PM, Jakub Jelinek wrote: >> + OpenMP 5.2: >> + >> + uses_allocators ( modifier : allocator-list ) > Please drop the -list above. > >> + uses_allocators ( modifier , modifier : allocator-list ) > and here too. Thanks for catching. >> + struct item_tok >> + { >> + location_t loc; >> + tree id; >> + item_tok (void) : loc (UNKNOWN_LOCATION), id (NULL_TREE) {} >> + }; >> + struct item { item_tok name, arg; }; >> + auto_vec *modifiers = NULL, *allocators = NULL; >> + auto_vec *cur_list = new auto_vec (4); > I was hoping you'd drop all this. > Seehttps://gcc.gnu.org/r13-1002 > for implementation (both C and C++ FE) of something very similar, > the only difference there is that in the case of linear clause, it is > looking for > val > ref > uval > step ( whatever ) > followed by , or ) > (anod ref and uval not in C FE), > while you are looking for > memspace ( whatever ) > traits ( whatever ) > followed by : or by , (in case of , repeat). > But in both cases you can actually use the same parser APIs > for raw token pre-parsing to just compute if it is the modifier > syntax or not, set bool has_modifiers based on that (when you > come over probably valid syntax followed by CPP_COLON). The linear clause doesn't have the legacy 'allocator1(t1), allocator2(t2), ...' requirement, and c_parser_omp_variable_list doesn't seem to support this pattern. Also, the way c_parser_omp_clause_linear is implemented doesn't support the requirement you mentioned earlier of allowing the use of "memspace", "traits" as the allocator name when it's actually not a modifier. I have merged the v4 patch with the syntax comments updated as above to devel/omp/gcc-11. Thanks, Chung-Lin