Hi,

On Fri, Dec 09, 2016 at 04:25:10PM +0300, Alexander Monakov wrote:
> Hi Martin,
> 
> Just one quick question -- do you know if config/nvptx/nvptx.c needs changes
> with this patch?  I see it has an '#include "omp-low.h"', and it seems your
> patch is renaming some functions -- is the intention that no interfaces used 
> in
> target-specific files are changed during the split?
> 

Unfortunately no, that file also needs to be changed, even if very
slightly.  Specifically, omp-general.h also needs to be included and
calls to get_oacc_fn_attrib need to be changed to call
oacc_get_fn_attrib.  omp-low.h has to stay included for
omp_reduction_init_op and omp_reduction_init which did not change.

Sorry about that, it was the only file in the back-ends and I forgot
about it.  I have added the following to my patch but it would be
great if you verified it still compiles and works as expected for you.

Thanks,

Martin


        * config/nvptx/nvptx.c: Include omp-generic.c.
        (nvptx_expand_call): Adjusted the call to get_oacc_fn_attrib to use
        its new name.
        (nvptx_reorg): Likewise.
        (nvptx_record_offload_symbol): Likewise.


diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nvptx/nvptx.c
index 405a91b..17fe551 100644
--- a/gcc/config/nvptx/nvptx.c
+++ b/gcc/config/nvptx/nvptx.c
@@ -55,6 +55,7 @@
 #include "gimple.h"
 #include "stor-layout.h"
 #include "builtins.h"
+#include "omp-general.h"
 #include "omp-low.h"
 #include "gomp-constants.h"
 #include "dumpfile.h"
@@ -1389,7 +1390,7 @@ nvptx_expand_call (rtx retval, rtx address)
          if (DECL_STATIC_CHAIN (decl))
            cfun->machine->has_chain = true;
 
-         tree attr = get_oacc_fn_attrib (decl);
+         tree attr = oacc_get_fn_attrib (decl);
          if (attr)
            {
              tree dims = TREE_VALUE (attr);
@@ -4090,7 +4091,7 @@ nvptx_reorg (void)
   /* Determine launch dimensions of the function.  If it is not an
      offloaded function  (i.e. this is a regular compiler), the
      function has no neutering.  */
-  tree attr = get_oacc_fn_attrib (current_function_decl);
+  tree attr = oacc_get_fn_attrib (current_function_decl);
   if (attr)
     {
       /* If we determined this mask before RTL expansion, we could
@@ -4243,7 +4244,7 @@ nvptx_record_offload_symbol (tree decl)
 
     case FUNCTION_DECL:
       {
-       tree attr = get_oacc_fn_attrib (decl);
+       tree attr = oacc_get_fn_attrib (decl);
        /* OpenMP offloading does not set this attribute.  */
        tree dims = attr ? TREE_VALUE (attr) : NULL_TREE;
 

Reply via email to