]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libgomp/sections.c
Regenerate libgomp/configure for copyright year update
[thirdparty/gcc.git] / libgomp / sections.c
index e9d99e434ac5afe4a2a2dc3396cea484b54bb806..5762ba8c8b5a33224c18cb42df7541839fb85e1e 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2022 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2024 Free Software Foundation, Inc.
    Contributed by Richard Henderson <rth@redhat.com>.
 
    This file is part of the GNU Offloading and Multi Processing Library
@@ -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));