Commit 5221d7a9 by Jakub Jelinek Committed by Jakub Jelinek

re PR libgomp/43569 (libgomp: Conditional jump or move depends on uninitialised value)

	PR libgomp/43569
	* sections.c (gomp_sections_init): Initialize ws->mode.

From-SVN: r158564
parent a837268b
2010-04-20 Jakub Jelinek <jakub@redhat.com>
PR libgomp/43569
* sections.c (gomp_sections_init): Initialize ws->mode.
2010-04-14 Uros Bizjak <ubizjak@gmail.com>
* acinclude.m4 (LIBGOMP_CHECK_SYNC_BUILTINS): Remove set but
......
/* Copyright (C) 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
/* Copyright (C) 2005, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
Contributed by Richard Henderson <rth@redhat.com>.
This file is part of the GNU OpenMP Library (libgomp).
......@@ -34,9 +34,25 @@ gomp_sections_init (struct gomp_work_share *ws, unsigned count)
{
ws->sched = GFS_DYNAMIC;
ws->chunk_size = 1;
ws->end = count + 1;
ws->end = count + 1L;
ws->incr = 1;
ws->next = 1;
#ifdef HAVE_SYNC_BUILTINS
/* Prepare things to make each iteration faster. */
if (sizeof (long) > sizeof (unsigned))
ws->mode = 1;
else
{
struct gomp_thread *thr = gomp_thread ();
struct gomp_team *team = thr->ts.team;
long nthreads = team ? team->nthreads : 1;
ws->mode = ((nthreads | ws->end)
< 1UL << (sizeof (long) * __CHAR_BIT__ / 2 - 1));
}
#else
ws->mode = 0;
#endif
}
/* This routine is called when first encountering a sections construct
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment