This is the mail archive of the
mailing list for the GCC project.
[libgomp, patch, committed] PR29949 - Set illegal thread count to 1
- From: Daniel Franke <franke dot daniel at gmail dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 4 Dec 2006 22:37:41 +0100
- Subject: [libgomp, patch, committed] PR29949 - Set illegal thread count to 1
- References: <email@example.com> <456F48CE.firstname.lastname@example.org>
On Thursday 30 November 2006 22:10, Diego Novillo wrote:
> Daniel Franke wrote on 11/23/06 15:25:
> > PR libgomp/29949
> > * env.c (omp_set_num_threads): Set illegal thread count to 1.
> Can't officially approve it, but this looks obvious.
Thus, committed under the obvious rule for trunk.
Tested on i686-pc-linux-gnu.
Since it is better to be save than sorry: the ChangeLog indicates a similar
fix that was not yet ported to 4.2. Should both changes, Uros and mine, be
applied to 4.2 as well?
2006-11-09 Uros Bizjak <email@example.com>
* env.c (parse_schedule): Reject out of range values.
(parse_unsigned_long): Reject out of range, negative or zero values.
--- libgomp/env.c (revision 119509)
+++ libgomp/env.c (working copy)
@@ -225,7 +225,7 @@
omp_set_num_threads (int n)
- gomp_nthreads_var = n;
+ gomp_nthreads_var = (n > 0 ? n : 1);