On Mon, Aug 16, 2021 at 10:08:42AM +0200, Thomas Schwinge wrote: > --- a/gcc/omp-general.c > +++ b/gcc/omp-general.c > @@ -2815,4 +2815,25 @@ oacc_get_ifn_dim_arg (const gimple *stmt) > return (int) axis; > } > > +/* Build COMPONENT_REF and set TREE_THIS_VOLATILE and TREE_READONLY on it > + as appropriate. */ > + > +tree > +omp_build_component_ref (tree obj, tree field) > +{ > + tree field_type = TREE_TYPE (field); > + tree obj_type = TREE_TYPE (obj); > + if (!ADDR_SPACE_GENERIC_P (TYPE_ADDR_SPACE (obj_type))) > + field_type > + = build_qualified_type (field_type, > + KEEP_QUAL_ADDR_SPACE (TYPE_QUALS (obj_type)));
Are you sure this can't trigger? Say extern int __seg_fs a; void foo (void) { #pragma omp parallel private (a) a = 2; } I think keeping the qual addr space here is the wrong thing to do, it should keep the other quals and clear the address space instead, the whole struct is going to be in generic addres space, isn't it? > + > + tree ret = build3 (COMPONENT_REF, field_type, obj, field, NULL); > + if (TREE_THIS_VOLATILE (field)) > + TREE_THIS_VOLATILE (ret) |= 1; > + if (TREE_READONLY (field)) > + TREE_READONLY (ret) |= 1; When touching these two, shouldn't it be better written as = 1; instead of |= 1; ? For a bitfield... Jakub