Hi!

I wonder if we shouldn't change:

  TREE_TYPE (ctx->receiver_decl)
    = build_qualified_type (build_reference_type (type), TYPE_QUAL_RESTRICT);

in fixup_child_record_type to add:

  if (is_gimple_omp_offloaded (ctx->stmt))
    type = build_qualified_type (type, TYPE_QUAL_CONST);

before it (and perhaps also add | TYPE_QUAL_CONST to TYPE_QUAL_RESTRICT for all
constructs).  I mean, aren't all the pointers in *.omp_data_i for the target
constructs constant in the offloaded region?  Perhaps that could result in
better generated code (though perhaps just the restrict helps enough).
Can you think of any case where it is not constant?

        Jakub

Reply via email to