This is the mail archive of the
gcc-patches@gcc.gnu.org
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: <200611232125.14809.franke.daniel@gmail.com> <456F48CE.90503@redhat.com>
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 <ubizjak@gmail.com>
* env.c (parse_schedule): Reject out of range values.
(parse_unsigned_long): Reject out of range, negative or zero values.
Regards
Daniel
Index: libgomp/env.c
===================================================================
--- libgomp/env.c (revision 119509)
+++ libgomp/env.c (working copy)
@@ -225,7 +225,7 @@
void
omp_set_num_threads (int n)
{
- gomp_nthreads_var = n;
+ gomp_nthreads_var = (n > 0 ? n : 1);
}
void