From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 829EE3858408 for ; Wed, 2 Mar 2022 13:30:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 829EE3858408 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-452-RSAt5UugMcG5YjMBy3lmaw-1; Wed, 02 Mar 2022 08:30:46 -0500 X-MC-Unique: RSAt5UugMcG5YjMBy3lmaw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7F1A9801DDB; Wed, 2 Mar 2022 13:30:45 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.81]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E734B7C0ED; Wed, 2 Mar 2022 13:30:44 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.16.1/8.16.1) with ESMTPS id 222DUfIf972370 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 2 Mar 2022 14:30:42 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.16.1/8.16.1/Submit) id 222DUejJ972369; Wed, 2 Mar 2022 14:30:40 +0100 Date: Wed, 2 Mar 2022 14:30:40 +0100 From: Jakub Jelinek To: Thomas Schwinge Cc: gcc-patches@gcc.gnu.org, fortran@gcc.gnu.org, asolokha@gmx.com, Julian Brown Subject: Re: OpenACC 'kernels' decomposition: Mark variables used in synthesized data clauses as addressable [PR100280] Message-ID: Reply-To: Jakub Jelinek References: <20190508145157.08beb4df@squid.athome> <87iluovu47.fsf@euler.schwinge.homeip.net> <87zgm9mxib.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 In-Reply-To: <87zgm9mxib.fsf@euler.schwinge.homeip.net> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_SHORT, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: fortran@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Fortran mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Mar 2022 13:30:56 -0000 On Tue, Mar 01, 2022 at 05:46:20PM +0100, Thomas Schwinge wrote: > OK to proceed in this way? With a suitable ChangeLog entry and one nit fixed yes. > --- gcc/omp-low.cc > +++ gcc/omp-low.cc > @@ -188,7 +188,7 @@ struct omp_context > static splay_tree all_contexts; > static int taskreg_nesting_level; > static int target_nesting_level; > -static bitmap task_shared_vars; > +static bitmap make_addressable_vars; > static bitmap global_nonaddressable_vars; > static vec taskreg_contexts; > static vec task_cpyfns; > @@ -572,9 +572,9 @@ use_pointer_for_field (tree decl, omp_context *shared_ctx) > /* Taking address of OUTER in lower_send_shared_vars > might need regimplification of everything that uses the > variable. */ > - if (!task_shared_vars) > - task_shared_vars = BITMAP_ALLOC (NULL); > - bitmap_set_bit (task_shared_vars, DECL_UID (outer)); > + if (!make_addressable_vars) > + make_addressable_vars = BITMAP_ALLOC (NULL); > + bitmap_set_bit (make_addressable_vars, DECL_UID (outer)); Has the MUA replaced tabs with spaces? > --- gcc/omp-oacc-kernels-decompose.cc > +++ gcc/omp-oacc-kernels-decompose.cc > @@ -845,7 +845,11 @@ maybe_build_inner_data_region (location_t loc, gimple *body, > prev_mapped_var = v; > > /* See . */ > - TREE_ADDRESSABLE (v) = 1; > + if (!TREE_ADDRESSABLE (v)) > + { > + /* Request that OMP lowering make 'v' addressable. */ > + OMP_CLAUSE_MAP_DECL_MAKE_ADDRESSABLE (new_clause) = 1; > + } That is a single statement body, so shouldn't have {}s around it. Jakub