From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa2.mentor.iphmx.com (esa2.mentor.iphmx.com [68.232.141.98]) by sourceware.org (Postfix) with ESMTPS id C26B33856099 for ; Mon, 6 Jun 2022 13:38:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C26B33856099 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,280,1647331200"; d="scan'208";a="76848741" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa2.mentor.iphmx.com with ESMTP; 06 Jun 2022 05:38:35 -0800 IronPort-SDR: B/NkjrmA0P2qakJ4YKs6QjRVHfXGjFPUzVD/WR/yiUZiVvVJONKoaTc9GAgIbWvllq4Wmn4yoH Vnm9E9KQPfIhXC6EsSPCRbygVYyAWsXHHcn6+F8L5PIFCxhaW08zL4AyU9uMt4MAPS453t3v9N iVG+RilnBR3s4kKkDdwRRiXm6IM+CZ5G5wTBWtnugjUv5715YdWWxsnYwCvKQOkrZzKlbANO45 LXmtj+eEJPRoisoGaMW0FSuqP4a1pDjT9D0PNy9i9NUdf68e0RSJ57VhsYUsr8MI94B/dBEHae H5g= Message-ID: <79484359-fa27-ebe1-48f7-025e7fca0f49@codesourcery.com> Date: Mon, 6 Jun 2022 21:38:30 +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, v2] 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> <58c6df9a-467a-1dc3-9386-b44af5515894@codesourcery.com> From: Chung-Lin Tang In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: svr-orw-mbx-15.mgc.mentorg.com (147.34.90.215) To svr-orw-mbx-10.mgc.mentorg.com (147.34.90.210) X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, NICE_REPLY_A, RCVD_IN_MSPIKE_H2, 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, 06 Jun 2022 13:38:38 -0000 On 2022/6/6 9:22 下午, Jakub Jelinek wrote: > On Mon, Jun 06, 2022 at 09:19:18PM +0800, Chung-Lin Tang wrote: >> On 2022/5/31 6:02 PM, Jakub Jelinek wrote: >>> 5) for C++, we should handle FIELD_DECLs, but it shouldn't be hard, just >>> look how it is handled for private too >>> >>> Jakub >> >> About private() for non-static members, is it really working right now? > > Perhaps we have a bug that we should file in bugzilla and should fix. > > Can you try omp parallel or omp target in the test instead? I see it works for omp parallel/task, gimplify results: void C::foo (struct C * const this) { omp_allocator_handle_t a [value-expr: ((struct C *) this)->a]; #pragma omp parallel private(a) { a = 0; } } I'll file a bugzilla for the target construct. That said, can we delay FIELD_DECL support for uses_allocators? (which is target construct only) Since it appears to be not trivial at the moment. Thanks, Chung-Lin >> A simple test: >> >> struct C { >> omp_allocator_handle_t a; >> void foo (void) { >> #pragma omp target private (a) >> a = (omp_allocator_handle_t) 0; >> } >> }; >> >> int main (void) >> { >> C c; >> c.foo (); >> return 0; >> } > > Jakub >