On Mon, May 16, 2022 at 05:14:12PM +0200, Tobias Burnus wrote:
> --- a/gcc/omp-low.cc
> +++ b/gcc/omp-low.cc
> @@ -3883,6 +3883,16 @@ check_omp_nesting_restrictions (gimple *stmt, 
> omp_context *ctx)
>               }
>             else
>               {
> +               if ((gimple_omp_target_kind (ctx->stmt)
> +                    == GF_OMP_TARGET_KIND_REGION)
> +                   && (gimple_omp_target_kind (stmt)
> +                       == GF_OMP_TARGET_KIND_REGION)
> +                   && ((c = omp_find_clause (
> +                              gimple_omp_target_clauses (stmt),
> +                              OMP_CLAUSE_DEVICE))
> +                       != NULL_TREE)
> +                   && OMP_CLAUSE_DEVICE_ANCESTOR (c))
> +                 break;

The ( at the end of line is too ugly for me.
Can't you write it as:
                  if ((gimple_omp_target_kind (ctx->stmt)
                       == GF_OMP_TARGET_KIND_REGION)
                      && (gimple_omp_target_kind (stmt)
                          == GF_OMP_TARGET_KIND_REGION))
                    {
                      c = omp_find_clause (gimple_omp_target_clauses (stmt),
                                           OMP_CLAUSE_DEVICE);
                      if (c && OMP_CLAUSE_DEVICE_ANCESTOR (c))
                        break;
                    }
?

Otherwise LGTM.

        Jakub

Reply via email to