re PR regression/63868 (Multiple failures in the libgomp test suite between r217458...
authorIlya Verbin <ilya.verbin@intel.com>
Wed, 19 Nov 2014 13:52:12 +0000 (13:52 +0000)
committerIlya Verbin <iverbin@gcc.gnu.org>
Wed, 19 Nov 2014 13:52:12 +0000 (13:52 +0000)
PR regression/63868
* cgraph.c (cgraph_node::create): Guard g->have_offload with
ifdef ENABLE_OFFLOADING.
* omp-low.c (create_omp_child_function): Likewise.
(expand_omp_target): Guard node->mark_force_output and offload_funcs
with ifdef ENABLE_OFFLOADING.
* varpool.c (varpool_node::get_create): Guard g->have_offload and
offload_vars with ifdef ENABLE_OFFLOADING.

From-SVN: r217773

gcc/ChangeLog
gcc/cgraph.c
gcc/omp-low.c
gcc/varpool.c

index c3e3d145003a8bf8dfc901c2270185d0e3cd3fd8..6e1f93069c19f82eff3e231578c4ca709fbfc7d2 100644 (file)
@@ -1,3 +1,14 @@
+2014-11-19  Ilya Verbin  <ilya.verbin@intel.com>
+
+       PR regression/63868
+       * cgraph.c (cgraph_node::create): Guard g->have_offload with
+       ifdef ENABLE_OFFLOADING.
+       * omp-low.c (create_omp_child_function): Likewise.
+       (expand_omp_target): Guard node->mark_force_output and offload_funcs
+       with ifdef ENABLE_OFFLOADING.
+       * varpool.c (varpool_node::get_create): Guard g->have_offload and
+       offload_vars with ifdef ENABLE_OFFLOADING.
+
 2014-11-19  Felix Yang  <felix.yang@huawei.com>
            Shanyao Chen  <chenshanyao@huawei.com>
 
index cc0474429ba27943a340352be94c0f2ea9bc2f0f..18ae6a807ce9b3a4f30ca90b52075baab94e5784 100644 (file)
@@ -500,7 +500,9 @@ cgraph_node::create (tree decl)
       && lookup_attribute ("omp declare target", DECL_ATTRIBUTES (decl)))
     {
       node->offloadable = 1;
+#ifdef ENABLE_OFFLOADING
       g->have_offload = true;
+#endif
     }
 
   node->register_symbol ();
index 9874fa5e4926714e9021aa57eb43fe8d7d4a2abe..ddb720c4a7f925912333c16793f3967af5abc18c 100644 (file)
@@ -1962,7 +1962,9 @@ create_omp_child_function (omp_context *ctx, bool task_copy)
        if (is_targetreg_ctx (octx))
          {
            cgraph_node::get_create (decl)->offloadable = 1;
+#ifdef ENABLE_OFFLOADING
            g->have_offload = true;
+#endif
            break;
          }
     }
@@ -8288,7 +8290,6 @@ expand_omp_target (struct omp_region *region)
   if (kind == GF_OMP_TARGET_KIND_REGION)
     {
       unsigned srcidx, dstidx, num;
-      struct cgraph_node *node;
 
       /* If the target region needs data sent from the parent
         function, then the very first statement (except possible
@@ -8415,18 +8416,22 @@ expand_omp_target (struct omp_region *region)
       DECL_STRUCT_FUNCTION (child_fn)->curr_properties = cfun->curr_properties;
       cgraph_node::add_new_function (child_fn, true);
 
+#ifdef ENABLE_OFFLOADING
       /* Add the new function to the offload table.  */
       vec_safe_push (offload_funcs, child_fn);
+#endif
 
       /* Fix the callgraph edges for child_cfun.  Those for cfun will be
         fixed in a following pass.  */
       push_cfun (child_cfun);
       cgraph_edge::rebuild_edges ();
 
+#ifdef ENABLE_OFFLOADING
       /* Prevent IPA from removing child_fn as unreachable, since there are no
         refs from the parent function to child_fn in offload LTO mode.  */
-      node = cgraph_node::get (child_fn);
+      struct cgraph_node *node = cgraph_node::get (child_fn);
       node->mark_force_output ();
+#endif
 
       /* Some EH regions might become dead, see PR34608.  If
         pass_cleanup_cfg isn't the first pass to happen with the
@@ -12503,7 +12508,7 @@ omp_finish_file (void)
 
       varpool_node::finalize_decl (vars_decl);
       varpool_node::finalize_decl (funcs_decl);
-   }
+    }
   else
     {
       for (unsigned i = 0; i < num_funcs; i++)
index 80dd496a49a23766141519615dfc1a266ca4c7de..50f2e6e755add8e69ee5886bba7fe8580f60d8e2 100644 (file)
@@ -171,9 +171,11 @@ varpool_node::get_create (tree decl)
       && lookup_attribute ("omp declare target", DECL_ATTRIBUTES (decl)))
     {
       node->offloadable = 1;
+#ifdef ENABLE_OFFLOADING
       g->have_offload = true;
       if (!in_lto_p)
        vec_safe_push (offload_vars, decl);
+#endif
     }
 
   node->register_symbol ();