always define ENABLE_OFFLOADING
authorTrevor Saunders <tbsaunde+gcc@tbsaunde.org>
Sun, 15 Nov 2015 00:18:08 +0000 (00:18 +0000)
committerTrevor Saunders <tbsaunde@gcc.gnu.org>
Sun, 15 Nov 2015 00:18:08 +0000 (00:18 +0000)
gcc/cp/ChangeLog:

2015-11-14  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

* parser.c (cp_parser_omp_declare_target): Adjust.

gcc/ChangeLog:

2015-11-14  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

* configure: Regenerate.
* configure.ac: Always define ENABLE_OFFLOADING.
* cgraph.c (cgraph_node::create): Adjust.
* gcc.c (process_command): Likewise.
* omp-low.c (create_omp_child_function): Likewise.
(expand_omp_target): Likewise.
* varpool.c (varpool_node::get_create): Likewise.

gcc/c/ChangeLog:

2015-11-14  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

* c-parser.c (c_parser_omp_declare_target): Adjust.

From-SVN: r230393

gcc/ChangeLog
gcc/c/ChangeLog
gcc/c/c-parser.c
gcc/cgraph.c
gcc/configure
gcc/configure.ac
gcc/cp/ChangeLog
gcc/cp/parser.c
gcc/gcc.c
gcc/omp-low.c
gcc/varpool.c

index 5b3bf501ad0229a0df3e2d87a575af75da9dd3ee..ed9560128bb5c1042e441bdc1cbf8c390d2bbe89 100644 (file)
@@ -1,3 +1,13 @@
+2015-11-14  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>
+
+       * configure: Regenerate.
+       * configure.ac: Always define ENABLE_OFFLOADING.
+       * cgraph.c (cgraph_node::create): Adjust.
+       * gcc.c (process_command): Likewise.
+       * omp-low.c (create_omp_child_function): Likewise.
+       (expand_omp_target): Likewise.
+       * varpool.c (varpool_node::get_create): Likewise.
+
 2015-11-14  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>
 
        * defaults.h (EH_RETURN_HANDLER_RTX): New default definition.
index 5be190fec6b7192d51e78f93703ed5ea2afa44fc..ce4d7c00dbdb18575be6473b14aabe4fe76aef6b 100644 (file)
@@ -1,3 +1,7 @@
+2015-11-14  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>
+
+       * c-parser.c (c_parser_omp_declare_target): Adjust.
+
 2015-11-14  Jakub Jelinek  <jakub@redhat.com>
 
        * c-typeck.c (c_finish_omp_clauses): Don't mark
index 943d3e58d279222f4a896d227e822dca1d3eac57..e470234d738350f2b9985469635239f3d47f2caf 100644 (file)
@@ -16300,14 +16300,15 @@ c_parser_omp_declare_target (c_parser *parser)
          if (node != NULL)
            {
              node->offloadable = 1;
-#ifdef ENABLE_OFFLOADING
-             g->have_offload = true;
-             if (is_a <varpool_node *> (node))
+             if (ENABLE_OFFLOADING)
                {
-                 vec_safe_push (offload_vars, t);
-                 node->force_output = 1;
+                 g->have_offload = true;
+                 if (is_a <varpool_node *> (node))
+                   {
+                     vec_safe_push (offload_vars, t);
+                     node->force_output = 1;
+                   }
                }
-#endif
            }
        }
     }
index 7839c720fe42cd1f1bae8fcc27d1b9fb5db42e7b..b1228a2d5de36fa08eaffb83432d789e33e9cf22 100644 (file)
@@ -499,9 +499,8 @@ cgraph_node::create (tree decl)
       && lookup_attribute ("omp declare target", DECL_ATTRIBUTES (decl)))
     {
       node->offloadable = 1;
-#ifdef ENABLE_OFFLOADING
-      g->have_offload = true;
-#endif
+      if (ENABLE_OFFLOADING)
+       g->have_offload = true;
     }
 
   node->register_symbol ();
index 4b4e72457a7ccb2f77ec63126234226831e19c2e..d5f6dd477b56431daf3405ec4de2f196616d90dd 100755 (executable)
@@ -7715,6 +7715,10 @@ if test x"$offload_targets" != x; then
 
 $as_echo "#define ENABLE_OFFLOADING 1" >>confdefs.h
 
+else
+
+$as_echo "#define ENABLE_OFFLOADING 0" >>confdefs.h
+
 fi
 
 
@@ -18402,7 +18406,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 18405 "configure"
+#line 18409 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -18508,7 +18512,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 18511 "configure"
+#line 18515 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
index 42d8f136e9cbd15a874e7fa66bffba2adc639cdc..34df54924973c8fba5268be9c505e90aad5231fe 100644 (file)
@@ -951,6 +951,9 @@ AC_DEFINE_UNQUOTED(OFFLOAD_TARGETS, "$offload_targets",
 if test x"$offload_targets" != x; then
   AC_DEFINE(ENABLE_OFFLOADING, 1,
     [Define this to enable support for offloading.])
+else
+  AC_DEFINE(ENABLE_OFFLOADING, 0,
+    [Define this to enable support for offloading.])
 fi
 
 AC_ARG_WITH(multilib-list,
index 1b052dca87a70c6d15e1b7d373cd048e11b7ffa2..322b6934067370755c790412c0b7c47a484b03ac 100644 (file)
@@ -1,3 +1,7 @@
+2015-11-14  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>
+
+       * parser.c (cp_parser_omp_declare_target): Adjust.
+
 2015-11-14  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>
 
        * vtable-class-hierarchy.c (vtv_generate_init_routine): Adjust.
index 4ca79830712e96ee4050a62fb69dfe3568533ad8..5e8614b37489c2fd499c61b5dd05a34417f48955 100644 (file)
@@ -35208,14 +35208,15 @@ cp_parser_omp_declare_target (cp_parser *parser, cp_token *pragma_tok)
          if (node != NULL)
            {
              node->offloadable = 1;
-#ifdef ENABLE_OFFLOADING
-             g->have_offload = true;
-             if (is_a <varpool_node *> (node))
+             if (ENABLE_OFFLOADING)
                {
-                 vec_safe_push (offload_vars, t);
-                 node->force_output = 1;
+                 g->have_offload = true;
+                 if (is_a <varpool_node *> (node))
+                   {
+                     vec_safe_push (offload_vars, t);
+                     node->force_output = 1;
+                   }
                }
-#endif
            }
        }
     }
index 7b1fd570c19b8b192dfc13a74ecf34b4c6de8c2f..cc0597dab395a07754181347148551eb0f1139cf 100644 (file)
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -4392,12 +4392,10 @@ process_command (unsigned int decoded_options_count,
                           CL_DRIVER, &handlers, global_dc);
     }
 
-#ifdef ENABLE_OFFLOADING
   /* If the user didn't specify any, default to all configured offload
      targets.  */
-  if (offload_targets == NULL)
+  if (ENABLE_OFFLOADING && offload_targets == NULL)
     handle_foffload_option (OFFLOAD_TARGETS);
-#endif
 
   if (output_file
       && strcmp (output_file, "-") != 0
index 987bc3ea60243c5471d0ed8bdf78bba2a3257133..58248d9288e086c8b2693d4766eceb9773565aab 100644 (file)
@@ -2424,9 +2424,9 @@ create_omp_child_function (omp_context *ctx, bool task_copy)
        if (is_gimple_omp_offloaded (octx->stmt))
          {
            cgraph_node::get_create (decl)->offloadable = 1;
-#ifdef ENABLE_OFFLOADING
-           g->have_offload = true;
-#endif
+           if (ENABLE_OFFLOADING)
+             g->have_offload = true;
+
            break;
          }
     }
@@ -12613,10 +12613,9 @@ expand_omp_target (struct omp_region *region)
       node->parallelized_function = 1;
       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
+      if (ENABLE_OFFLOADING)
+       vec_safe_push (offload_funcs, child_fn);
 
       bool need_asm = DECL_ASSEMBLER_NAME_SET_P (current_function_decl)
                      && !DECL_ASSEMBLER_NAME_SET_P (child_fn);
@@ -12628,11 +12627,10 @@ expand_omp_target (struct omp_region *region)
        assign_assembler_name_if_neeeded (child_fn);
       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.  */
-      cgraph_node::get (child_fn)->mark_force_output ();
-#endif
+      if (ENABLE_OFFLOADING)
+       cgraph_node::get (child_fn)->mark_force_output ();
 
       /* Some EH regions might become dead, see PR34608.  If
         pass_cleanup_cfg isn't the first pass to happen with the
index 478f3655a51ae5ceb493f92e723725cb3151f66a..36f19a62ba825cf33250f7bcd748877cdff61bad 100644 (file)
@@ -153,12 +153,13 @@ 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);
-      node->force_output = 1;
-#endif
+      if (ENABLE_OFFLOADING)
+       {
+         g->have_offload = true;
+         if (!in_lto_p)
+           vec_safe_push (offload_vars, decl);
+         node->force_output = 1;
+       }
     }
 
   node->register_symbol ();