re PR target/65697 (__atomic memory barriers not strong enough for __sync builtins)
[gcc.git] / gcc / omp-low.c
index 77716bf6c20c7aaf23f901b796ef18379b6c5102..8218403f6803c32ea63da5c4558c920f6c313b26 100644 (file)
@@ -26,7 +26,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "system.h"
 #include "coretypes.h"
 #include "tm.h"
-#include "input.h"
 #include "alias.h"
 #include "symtab.h"
 #include "tree.h"
@@ -45,7 +44,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "internal-fn.h"
 #include "gimple-fold.h"
 #include "gimple-expr.h"
-#include "is-a.h"
 #include "gimple.h"
 #include "gimplify.h"
 #include "gimple-iterator.h"
@@ -56,8 +54,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "langhooks.h"
 #include "diagnostic-core.h"
 #include "gimple-ssa.h"
-#include "plugin-api.h"
-#include "ipa-ref.h"
 #include "cgraph.h"
 #include "tree-cfg.h"
 #include "tree-phinodes.h"
@@ -5589,7 +5585,9 @@ expand_omp_taskreg (struct omp_region *region)
        vec_safe_truncate (child_cfun->local_decls, dstidx);
 
       /* Inform the callgraph about the new function.  */
-      DECL_STRUCT_FUNCTION (child_fn)->curr_properties = cfun->curr_properties;
+      child_cfun->curr_properties = cfun->curr_properties;
+      child_cfun->has_simduid_loops |= cfun->has_simduid_loops;
+      child_cfun->has_force_vectorize_loops |= cfun->has_force_vectorize_loops;
       cgraph_node *node = cgraph_node::get_create (child_fn);
       node->parallelized_function = 1;
       cgraph_node::add_new_function (child_fn, true);
@@ -7838,6 +7836,8 @@ expand_omp_simd (struct omp_region *region, struct omp_for_data *fd)
          cfun->has_force_vectorize_loops = true;
        }
     }
+  else if (simduid)
+    cfun->has_simduid_loops = true;
 }
 
 
@@ -8958,7 +8958,9 @@ expand_omp_target (struct omp_region *region)
        vec_safe_truncate (child_cfun->local_decls, dstidx);
 
       /* Inform the callgraph about the new function.  */
-      DECL_STRUCT_FUNCTION (child_fn)->curr_properties = cfun->curr_properties;
+      child_cfun->curr_properties = cfun->curr_properties;
+      child_cfun->has_simduid_loops |= cfun->has_simduid_loops;
+      child_cfun->has_force_vectorize_loops |= cfun->has_force_vectorize_loops;
       cgraph_node *node = cgraph_node::get_create (child_fn);
       node->parallelized_function = 1;
       cgraph_node::add_new_function (child_fn, true);
@@ -8976,8 +8978,7 @@ expand_omp_target (struct omp_region *region)
 #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.  */
-      struct cgraph_node *node = cgraph_node::get (child_fn);
-      node->mark_force_output ();
+      cgraph_node::get (child_fn)->mark_force_output ();
 #endif
 
       /* Some EH regions might become dead, see PR34608.  If