]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libgomp/loop_ull.c
RISC-V: Implement -m{,no}fence-tso
[thirdparty/gcc.git] / libgomp / loop_ull.c
index 2aaa34e3bca673766d859022563efb4171d82172..efee976d105b8ab6ac0fbbd01b7e5c38fd3d2ac8 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
@@ -269,8 +269,11 @@ GOMP_loop_ull_start (bool up, gomp_ull start, gomp_ull end,
 #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));