re PR target/80090 (Incorrect assembler - output_addr_const may generate visibility...
[gcc.git] / libgomp / iter_ull.c
index 5d542bfabc6e4428e8df0323bd707bed94fdb102..e83ae035267b191811d4c2cf22d4918b8daf7cd5 100644 (file)
@@ -1,7 +1,8 @@
-/* Copyright (C) 2005-2015 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2017 Free Software Foundation, Inc.
    Contributed by Richard Henderson <rth@redhat.com>.
 
-   This file is part of the GNU OpenMP Library (libgomp).
+   This file is part of the GNU Offloading and Multi Processing Library
+   (libgomp).
 
    Libgomp is free software; you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by
@@ -218,7 +219,7 @@ gomp_iter_ull_dynamic_next (gomp_ull *pstart, gomp_ull *pend)
        }
     }
 
-  start = ws->next_ull;
+  start = __atomic_load_n (&ws->next_ull, MEMMODEL_RELAXED);
   while (1)
     {
       gomp_ull left = end - start;
@@ -304,7 +305,7 @@ gomp_iter_ull_guided_next (gomp_ull *pstart, gomp_ull *pend)
   gomp_ull start, end, nend, incr;
   gomp_ull chunk_size;
 
-  start = ws->next_ull;
+  start = __atomic_load_n (&ws->next_ull, MEMMODEL_RELAXED);
   end = ws->end_ull;
   incr = ws->incr_ull;
   chunk_size = ws->chunk_size_ull;