On Wed, Oct 28, 2015 at 01:26:31PM -0700, Nathan Sidwell wrote:
> looking at the next thing to merge, I stumbled on code in lower_omp_target
> that appears at least confused.
> 
> we have:
>   if (offloaded || data_region)
>     {  A }
>   else if (data_region)
>     new_body = tgt_body;
>   if (offloaded || data_region)
>     { B }
> 
> which can clearly be simplified to:
> 
>    if (offloaded || data_region)
>      { A; B; }
> 
> If that's incorrect, is the first '|| data_region' wrong?
> 
> nathan

> 2015-10-28  Nathan Sidwell  <nat...@codesourcery.com>
> 
>       * omp-low.c (lower_omp_target): Remove unreachable code & merge
>       ifs.

Your patch is fine.  The reason for the "|| data_region" addition has been
OMP_CLAUSE_USE_DEVICE_PTR clause support for OpenMP 4.5, without which
nothing will be added to new_body sequence, other than tgt_body, so it is
functionally equivalent in that case to the now unreachable code.

Ok for trunk, thanks.

        Jakub
  • omp cleanup Nathan Sidwell
    • Re: omp cleanup Jakub Jelinek

Reply via email to