summaryrefslogtreecommitdiff
path: root/libgomp/omp.h.in
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2021-10-01 10:32:10 +0200
committerJakub Jelinek <jakub@redhat.com>2021-10-01 10:32:10 +0200
commit998e434f8f9ce42842710af9e33c1b9732b22999 (patch)
tree81ef10d26946e81329f6d0227fb5b3807e04b366 /libgomp/omp.h.in
parent701075864ac4d1c6cec936d10f9cfc2aeb8c1699 (diff)
openmp: Add alloc_align attribute to omp_aligned_*alloc and testcase for omp_realloc
This patch adds alloc_align attribute to omp_aligned_{,c}alloc so that if the first argument is constant, GCC can assume requested alignment. Additionally, it adds testsuite coverage for omp_realloc which I haven't managed to write in the patch from yesterday. 2021-10-01 Jakub Jelinek <jakub@redhat.com> * omp.h.in (omp_aligned_alloc, omp_aligned_calloc): Add __alloc_align__ (1) attribute. * testsuite/libgomp.c-c++-common/alloc-9.c: New test.
Diffstat (limited to 'libgomp/omp.h.in')
-rw-r--r--libgomp/omp.h.in4
1 files changed, 2 insertions, 2 deletions
diff --git a/libgomp/omp.h.in b/libgomp/omp.h.in
index e39988e7cbd..d75ee13c16d 100644
--- a/libgomp/omp.h.in
+++ b/libgomp/omp.h.in
@@ -306,7 +306,7 @@ extern void *omp_aligned_alloc (__SIZE_TYPE__, __SIZE_TYPE__,
omp_allocator_handle_t
__GOMP_DEFAULT_NULL_ALLOCATOR)
__GOMP_NOTHROW __attribute__((__malloc__, __malloc__ (omp_free),
- __alloc_size__ (2)));
+ __alloc_size__ (2), __alloc_align__ (1)));
extern void *omp_calloc (__SIZE_TYPE__, __SIZE_TYPE__,
omp_allocator_handle_t __GOMP_DEFAULT_NULL_ALLOCATOR)
__GOMP_NOTHROW __attribute__((__malloc__, __malloc__ (omp_free),
@@ -315,7 +315,7 @@ extern void *omp_aligned_calloc (__SIZE_TYPE__, __SIZE_TYPE__, __SIZE_TYPE__,
omp_allocator_handle_t
__GOMP_DEFAULT_NULL_ALLOCATOR)
__GOMP_NOTHROW __attribute__((__malloc__, __malloc__ (omp_free),
- __alloc_size__ (2, 3)));
+ __alloc_size__ (2, 3), __alloc_align__ (1)));
extern void *omp_realloc (void *, __SIZE_TYPE__,
omp_allocator_handle_t __GOMP_DEFAULT_NULL_ALLOCATOR,
omp_allocator_handle_t __GOMP_DEFAULT_NULL_ALLOCATOR)