]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Don't parallelize loops if libgomp not supported
authorTom de Vries <tom@codesourcery.com>
Mon, 11 Jan 2016 08:55:16 +0000 (08:55 +0000)
committerTom de Vries <vries@gcc.gnu.org>
Mon, 11 Jan 2016 08:55:16 +0000 (08:55 +0000)
2016-01-11  Tom de Vries  <tom@codesourcery.com>

PR tree-optimization/69058
* tree-parloops.c (pass_parallelize_loops::execute): Return 0 if libgomp
not supported.

From-SVN: r232208

gcc/ChangeLog
gcc/tree-parloops.c

index c1982b6ba48da688a09bff2d8a2c5458872338a3..e717fc5e013029d35e9e9a904ae76f63c872b267 100644 (file)
@@ -1,3 +1,9 @@
+2016-01-11  Tom de Vries  <tom@codesourcery.com>
+
+       PR tree-optimization/69058
+       * tree-parloops.c (pass_parallelize_loops::execute): Return 0 if libgomp
+       not supported.
+
 2016-01-11  Andrew Burgess  <andrew.burgess@embecosm.com>
 
        * config/arc/arc.opt (mdiv-rem): Add period to the end.
index 5bd9c06f31542fa5e5a928a89754f7fad9997eea..e05cc4746d71355b5a98157be55c8f1cf76fdcaf 100644 (file)
@@ -2836,6 +2836,10 @@ pass_parallelize_loops::execute (function *fun)
   if (number_of_loops (fun) <= 1)
     return 0;
 
+  tree nthreads = builtin_decl_explicit (BUILT_IN_OMP_GET_NUM_THREADS);
+  if (nthreads == NULL_TREE)
+    return 0;
+
   if (parallelize_loops ())
     {
       fun->curr_properties &= ~(PROP_gimple_eomp);