[PATCH v3 05/11] OpenMP: push attaches to end of clause list in "target" regions

Julian Brown julian@codesourcery.com
Sun Sep 18 19:10:00 GMT 2022


On Wed, 14 Sep 2022 14:44:54 +0200
Jakub Jelinek <jakub@redhat.com> wrote:

> On Tue, Sep 13, 2022 at 02:03:15PM -0700, Julian Brown wrote:
> > This patch moves GOMP_MAP_ATTACH{_ZERO_LENGTH_ARRAY_SECTION} nodes
> > to the end of the clause list, for offload regions.  This ensures
> > that when we do the attach operation, both the "attachment point"
> > and the target region have both already been mapped on the target.
> > This avoids a pathological case that can otherwise happen with
> > struct sibling-list handling.
> > 
> > 2022-09-13  Julian Brown  <julian@codesourcery.com>
> > 
> > gcc/
> > 	* gimplify.cc (omp_segregate_mapping_groups): Update
> > comment. (omp_push_attaches_to_end): New function.
> > 	(gimplify_scan_omp_clauses): Use omp_push_attaches_to_end
> > for offloaded regions.  
> 
> Shouldn't this be done at the end of gimplify_adjust_omp_clauses?
> I mean, can't further attach clauses appear because of declare mapper
> for implicitly mapped variables?
> Other than that, it is yet another walk of the whole clause list, so
> would be nicer if it could be done in an existing walk over the
> clauses or at least have a flag whether there are any such clauses
> present and do it only in that case.
> If it could be done in the main gimplify_adjust_omp_clauses loop,
> nice, if it can appear also during
>   splay_tree_foreach (ctx->variables, gimplify_adjust_omp_clauses_1,
> &data); that isn't the case.

I don't think any ATTACH clauses can appear during
the gimplify_adjust_omp_clause_1 walk. So, how about this?

Thanks,

Julian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-OpenMP-Push-attaches-to-end-of-clause-list-in-target.patch
Type: text/x-patch
Size: 6103 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/fortran/attachments/20220918/9880fdf3/attachment.bin>


More information about the Fortran mailing list