Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2878)

Unified Diff: gcc/libgomp/sections.c

Issue 3050029: [gcc] GCC 4.5.0=>4.5.1 (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/nacl-toolchain.git
Patch Set: Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gcc/libgomp/configure ('k') | gcc/libgomp/testsuite/lib/libgomp.exp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gcc/libgomp/sections.c
diff --git a/gcc/libgomp/sections.c b/gcc/libgomp/sections.c
index 7acd441de53e908371e8647cc2c005b6c5a114d9..c7f49b7c32ad23836a77414a52caef87ec377a11 100644
--- a/gcc/libgomp/sections.c
+++ b/gcc/libgomp/sections.c
@@ -1,4 +1,4 @@
-/* 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
« no previous file with comments | « gcc/libgomp/configure ('k') | gcc/libgomp/testsuite/lib/libgomp.exp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698