On Tue, Sep 13, 2022 at 02:01:42PM -0700, Julian Brown wrote: > --- a/gcc/omp-low.cc > +++ b/gcc/omp-low.cc > @@ -1599,8 +1599,11 @@ scan_sharing_clauses (tree clauses, omp_context *ctx) > { > /* If this is an offloaded region, an attach operation should > only exist when the pointer variable is mapped in a prior > - clause. */ > - if (is_gimple_omp_offloaded (ctx->stmt)) > + clause. > + If we had an error, we may not have attempted to sort clauses > + properly, so avoid the test. */ > + if (is_gimple_omp_offloaded (ctx->stmt) > + && !seen_error ())
I'll repeat that it would be better if we just leave out the whole GOMP_TARGET if there were errors regarding it and the clauses aren't sorted properly. But I'm ok if it is handled incrementally and this spot reverted. Otherwise LGTM. Jakub