aboutsummaryrefslogtreecommitdiff
path: root/libgomp/sections.c
diff options
context:
space:
mode:
authorIain Sandoe <iain@sandoe.co.uk>2022-04-29 17:54:39 +0100
committerIain Sandoe <iain@sandoe.co.uk>2022-04-29 17:54:39 +0100
commit3e5f7ca352c26a222bb588741b7c700a3052a372 (patch)
tree283aec084274668fe34c23c49ab2999390ed9778 /libgomp/sections.c
parent2ce0608ca3dca30518bec525c435f7bc4d7f9b70 (diff)
parentb85e79dce149df68b92ef63ca2a40ff1dfa61396 (diff)
downloadgcc-devel/c++-coroutines.zip
gcc-devel/c++-coroutines.tar.gz
gcc-devel/c++-coroutines.tar.bz2
Merge master r12-8312.devel/c++-coroutines
* Merge master r12-8312-gb85e79dce149.
Diffstat (limited to 'libgomp/sections.c')
-rw-r--r--libgomp/sections.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libgomp/sections.c b/libgomp/sections.c
index e9d99e4..7751d5a 100644
--- a/libgomp/sections.c
+++ b/libgomp/sections.c
@@ -121,8 +121,11 @@ GOMP_sections2_start (unsigned count, uintptr_t *reductions, void **mem)
#define INLINE_ORDERED_TEAM_IDS_OFF \
((offsetof (struct gomp_work_share, inline_ordered_team_ids) \
+ __alignof__ (long long) - 1) & ~(__alignof__ (long long) - 1))
- if (size > (sizeof (struct gomp_work_share)
- - INLINE_ORDERED_TEAM_IDS_OFF))
+ if (sizeof (struct gomp_work_share)
+ <= INLINE_ORDERED_TEAM_IDS_OFF
+ || __alignof__ (struct gomp_work_share) < __alignof__ (long long)
+ || size > (sizeof (struct gomp_work_share)
+ - INLINE_ORDERED_TEAM_IDS_OFF))
*mem
= (void *) (thr->ts.work_share->ordered_team_ids
= gomp_malloc_cleared (size));