Hi Nathan!

On Tue, 10 Nov 2015 09:19:50 -0500, Nathan Sidwell <nat...@acm.org> wrote:
> I've committed this to backport a bunch of random bits from trunk to gomp4, 
> and 
> thereby reduce divergence.

Yeah, I had some of these on my list, too.

> --- omp-low.c (revision 230080)
> +++ omp-low.c (working copy)
> @@ -12515,7 +12485,7 @@ replace_oacc_fn_attrib (tree fn, tree di
>     function attribute.  Push any that are non-constant onto the ARGS
>     list, along with an appropriate GOMP_LAUNCH_DIM tag.  */
>  
> -void
> +static void
>  set_oacc_fn_attrib (tree fn, tree clauses, vec<tree> *args)
>  {
>    /* Must match GOMP_DIM ordering.  */

    [...]/gcc/omp-low.c: In function 'void set_oacc_fn_attrib(tree, tree, 
vec<tree_node*>*)':
    [...]/gcc/omp-low.c:12578:59: error: 'void set_oacc_fn_attrib(tree, tree, 
vec<tree_node*>*)' was declared 'extern' and later 'static' [-fpermissive]
     set_oacc_fn_attrib (tree fn, tree clauses, vec<tree> *args)
                                                               ^
    In file included from [...]/gcc/omp-low.c:71:0:
    [...]/gcc/omp-low.h:36:13: error: previous declaration of 'void 
set_oacc_fn_attrib(tree, tree, vec<tree_node*>*)' [-fpermissive]
     extern void set_oacc_fn_attrib (tree, tree, vec<tree> *);
                 ^
    Makefile:1083: recipe for target 'omp-low.o' failed
    make[2]: *** [omp-low.o] Error 1

If it's intended to be static in gcc/omp-low.c, you'll need to change
gcc/tree-parloops.c:create_parallel_loop to not use it.

> @@ -15530,7 +15499,7 @@ lower_omp_target (gimple_stmt_iterator *
>         case OMP_CLAUSE_MAP:
>         case OMP_CLAUSE_TO:
>         case OMP_CLAUSE_FROM:
> -       oacc_firstprivate_2:
> +       oacc_firstprivate_map:
>           nc = c;
>           ovar = OMP_CLAUSE_DECL (c);
>           if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_MAP

We got another label oacc_firstprivate above this one, which is why I had
named this oacc_firstprivate_2 -- no idea if oacc_firstprivate_map is a
"better" name.

> @@ -15581,9 +15550,9 @@ lower_omp_target (gimple_stmt_iterator *
>               x = build_sender_ref (ovar, ctx);
>  
>               if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_MAP
> -                      && OMP_CLAUSE_MAP_KIND (c) == GOMP_MAP_POINTER
> -                      && !OMP_CLAUSE_MAP_ZERO_BIAS_ARRAY_SECTION (c)
> -                      && TREE_CODE (TREE_TYPE (ovar)) == ARRAY_TYPE)
> +                 && OMP_CLAUSE_MAP_KIND (c) == GOMP_MAP_POINTER
> +                 && !OMP_CLAUSE_MAP_ZERO_BIAS_ARRAY_SECTION (c)
> +                 && TREE_CODE (TREE_TYPE (ovar)) == ARRAY_TYPE)
>                 {
>                   gcc_assert (offloaded);
>                   tree avar

Needs to be fixed on trunk, I think?

> @@ -15727,8 +15696,7 @@ lower_omp_target (gimple_stmt_iterator *
>  
>         case OMP_CLAUSE_FIRSTPRIVATE:
>           if (is_oacc_parallel (ctx))
> -           goto oacc_firstprivate_2;
> -         gcc_assert (!is_gimple_omp_oacc (ctx->stmt));
> +           goto oacc_firstprivate_map;
>           ovar = OMP_CLAUSE_DECL (c);
>           if (is_reference (ovar))
>             talign = TYPE_ALIGN_UNIT (TREE_TYPE (TREE_TYPE (ovar)));

I had put in the "gcc_assert (!is_gimple_omp_oacc (ctx->stmt))" to make
sure we don't ever reach this for OpenACC kernels, which will not "goto
oacc_firstprivate_2" because that's only being done for
"is_oacc_parallel" (but not for "is_oacc_kernels").


Grüße
 Thomas

Attachment: signature.asc
Description: PGP signature

Reply via email to