-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path141-gcc-4.4-ktietz-libgomp.patch
78 lines (72 loc) · 2.85 KB
/
141-gcc-4.4-ktietz-libgomp.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
From 897c83e970a1d4c2a2bfbc1acf9b3fedd35a627b Mon Sep 17 00:00:00 2001
From: Tim Stahlhut <stahta01@gmail.com>
Date: Thu, 27 Jun 2019 09:40:37 -0400
Subject: ktietz libgomp
Created by someone other than me.
---
libgomp/team.c | 6 +++---
libgomp/testsuite/config/default.exp | 4 ++++
libgomp/work.c | 4 ++--
3 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/libgomp/team.c b/libgomp/team.c
index e6a6d8ff679..1f70c03b505 100644
--- a/libgomp/team.c
+++ b/libgomp/team.c
@@ -145,7 +145,7 @@ gomp_new_team (unsigned nthreads)
size = sizeof (*team) + nthreads * (sizeof (team->ordered_release[0])
+ sizeof (team->implicit_task[0]));
- team = gomp_malloc (size);
+ team = gomp_malloc_cleared (size);
team->work_share_chunk = 8;
#ifdef HAVE_SYNC_BUILTINS
@@ -196,7 +196,7 @@ free_team (struct gomp_team *team)
static struct gomp_thread_pool *gomp_new_thread_pool (void)
{
struct gomp_thread_pool *pool
- = gomp_malloc (sizeof(struct gomp_thread_pool));
+ = gomp_malloc_cleared (sizeof(struct gomp_thread_pool));
pool->threads = NULL;
pool->threads_size = 0;
pool->threads_used = 0;
@@ -939,7 +939,7 @@ struct gomp_task_icv *
gomp_new_icv (void)
{
struct gomp_thread *thr = gomp_thread ();
- struct gomp_task *task = gomp_malloc (sizeof (struct gomp_task));
+ struct gomp_task *task = gomp_malloc_cleared (sizeof (struct gomp_task));
gomp_init_task (task, NULL, &gomp_global_icv);
thr->task = task;
pthread_setspecific (gomp_thread_destructor, thr);
diff --git a/libgomp/testsuite/config/default.exp b/libgomp/testsuite/config/default.exp
index 197327cd33a..1a4a37d075b 100644
--- a/libgomp/testsuite/config/default.exp
+++ b/libgomp/testsuite/config/default.exp
@@ -15,3 +15,7 @@
# <http://www.gnu.org/licenses/>.
load_lib "standard.exp"
+
+# Support for old dejagnu. Must be loaded here, not in libstdc++.exp, to
+# make sure all existing procs are loaded when their presence is tested.
+load_file $srcdir/../../gcc/testsuite/lib/dejapatches.exp
diff --git a/libgomp/work.c b/libgomp/work.c
index bb563b88772..21ba5a94d3a 100644
--- a/libgomp/work.c
+++ b/libgomp/work.c
@@ -75,7 +75,7 @@ alloc_work_share (struct gomp_team *team)
#endif
team->work_share_chunk *= 2;
- ws = gomp_malloc (team->work_share_chunk * sizeof (struct gomp_work_share));
+ ws = gomp_malloc_cleared (team->work_share_chunk * sizeof (struct gomp_work_share));
ws->next_alloc = team->work_shares[0].next_alloc;
team->work_shares[0].next_alloc = ws;
team->work_share_list_alloc = &ws[1];
@@ -174,7 +174,7 @@ gomp_work_share_start (bool ordered)
/* Work sharing constructs can be orphaned. */
if (team == NULL)
{
- ws = gomp_malloc (sizeof (*ws));
+ ws = gomp_malloc_cleared (sizeof (*ws));
gomp_init_work_share (ws, ordered, 1);
thr->ts.work_share = ws;
return ws;
--