On Mon, 17 May 2021 21:07:19 +0800
Chung-Lin Tang <clt...@codesourcery.com> wrote:

> Hi Julian,
> 
> On 2021/5/15 5:27 AM, Julian Brown wrote:
> > GCC currently raises a parse error for indirect accesses to struct
> > members, where the base of the access is a reference to a pointer.
> > This patch fixes that case.  
> 
> > gcc/cp/
> >     * semantics.c (finish_omp_clauses): Handle components of
> > references to pointers to structs.
> > 
> > libgomp/
> >     * testsuite/libgomp.oacc-c++/deep-copy-17.C: Update test.  
> 
> > --- a/gcc/cp/semantics.c
> > +++ b/gcc/cp/semantics.c
> > @@ -7670,7 +7670,12 @@ finish_omp_clauses (tree clauses, enum
> > c_omp_region_type ort) if ((ort == C_ORT_ACC || ort == C_ORT_OMP)
> >           && TREE_CODE (t) == COMPONENT_REF
> >           && TREE_CODE (TREE_OPERAND (t, 0)) == INDIRECT_REF)
> > -       t = TREE_OPERAND (TREE_OPERAND (t, 0), 0);
> > +       {
> > +         t = TREE_OPERAND (TREE_OPERAND (t, 0), 0);
> > +         /* References to pointers have a double indirection
> > here.  */
> > +         if (TREE_CODE (t) == INDIRECT_REF)
> > +           t = TREE_OPERAND (t, 0);
> > +       }
> >       if (TREE_CODE (t) == COMPONENT_REF
> >           && ((ort & C_ORT_OMP_DECLARE_SIMD) == C_ORT_OMP
> >               || ort == C_ORT_ACC)  
> 
> There is already a large plethora of such modifications in this patch:
> "[PATCH, OG10, OpenMP 5.0, committed] Remove array section
> base-pointer mapping semantics, and other front-end adjustments."
> https://gcc.gnu.org/pipermail/gcc-patches/2021-May/570075.html
> 
> I am in the process of taking that patch to mainline, so are you sure
> this is not already handled there?

Hmm, it might be -- thanks. Consider this patch withdrawn if so. (But
yeah, keep the test case by all means!)

Julian

Reply via email to