From e9ff08b28d529ceb14b39f207733c6f5faf833d6 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Mon, 11 Jan 2016 08:55:16 +0000 Subject: [PATCH] Don't parallelize loops if libgomp not supported 2016-01-11 Tom de Vries PR tree-optimization/69058 * tree-parloops.c (pass_parallelize_loops::execute): Return 0 if libgomp not supported. From-SVN: r232208 --- gcc/ChangeLog | 6 ++++++ gcc/tree-parloops.c | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c1982b6ba48d..e717fc5e0130 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2016-01-11 Tom de Vries + + PR tree-optimization/69058 + * tree-parloops.c (pass_parallelize_loops::execute): Return 0 if libgomp + not supported. + 2016-01-11 Andrew Burgess * config/arc/arc.opt (mdiv-rem): Add period to the end. diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c index 5bd9c06f3154..e05cc4746d71 100644 --- a/gcc/tree-parloops.c +++ b/gcc/tree-parloops.c @@ -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); -- 2.47.2