coarray_43.f90: Add "-latomic" option if libatomic_available.
[gcc.git] / libatomic / cas_n.c
index 801262d551c4bbf5079a8b3a58977f230a03d653..1b0a350565fac175af3a5f731cc28e5347a2e2d6 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012-2014 Free Software Foundation, Inc.
+/* Copyright (C) 2012-2017 Free Software Foundation, Inc.
    Contributed by Richard Henderson <rth@redhat.com>.
 
    This file is part of the GNU Atomic Library (libatomic).
@@ -70,7 +70,7 @@ SIZE(libat_compare_exchange) (UTYPE *mptr, UTYPE *eptr, UTYPE newval,
       mask = -1;
     }
 
-  weval = *eptr << shift;
+  weval = (UWORD)*eptr << shift;
   wnewval = (UWORD)newval << shift;
   woldval = __atomic_load_n (wptr, __ATOMIC_RELAXED);
   do