From c9f357688263239dee41cef4762f0ad78c1bb442 Mon Sep 17 00:00:00 2001 From: Olivier Hainque Date: Thu, 31 May 2018 10:46:58 +0000 Subject: [PATCH] [Ada] Update comment on __atomic_compare_exchange in s-atomic_primitives Remove mention of unavailability, long obsolete, and reword suggestion of use to indicate that we might want to switch to an internal interface using them. The current wording suggests just that we should bind the current Sync_Compare_And_Swap Ada subprograms to __atomic_compare builtins instead of __sync_compare, which would be highly confusing. 2018-05-31 Olivier Hainque gcc/ada/ * libgnat/s-atopri.ads: Update comment on __atomic_compare_exchange builtins. From-SVN: r261008 --- gcc/ada/ChangeLog | 5 +++++ gcc/ada/libgnat/s-atopri.ads | 26 ++++++++++++++------------ 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 446d65267f0..6150102dc1a 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2018-05-31 Olivier Hainque + + * libgnat/s-atopri.ads: Update comment on __atomic_compare_exchange + builtins. + 2018-05-31 Eric Botcazou * gcc-interface/trans.c (Call_to_gnu): If this is a function call and diff --git a/gcc/ada/libgnat/s-atopri.ads b/gcc/ada/libgnat/s-atopri.ads index d249ec29159..5cb15465fc1 100644 --- a/gcc/ada/libgnat/s-atopri.ads +++ b/gcc/ada/libgnat/s-atopri.ads @@ -92,18 +92,6 @@ package System.Atomic_Primitives is Sync_Compare_And_Swap_8, "__sync_val_compare_and_swap_1"); - -- ??? Should use __atomic_compare_exchange_1 (doesn't work yet): - -- function Sync_Compare_And_Swap_8 - -- (Ptr : Address; - -- Expected : Address; - -- Desired : uint8; - -- Weak : Boolean := False; - -- Success_Model : Mem_Model := Seq_Cst; - -- Failure_Model : Mem_Model := Seq_Cst) return Boolean; - -- pragma Import (Intrinsic, - -- Sync_Compare_And_Swap_8, - -- "__atomic_compare_exchange_1"); - function Sync_Compare_And_Swap_16 (Ptr : Address; Expected : uint16; @@ -128,6 +116,20 @@ package System.Atomic_Primitives is Sync_Compare_And_Swap_64, "__sync_val_compare_and_swap_8"); + -- ??? We might want to switch to the __atomic series of builtins for + -- compare-and-swap operations at some point. + + -- function Atomic_Compare_Exchange_8 + -- (Ptr : Address; + -- Expected : Address; + -- Desired : uint8; + -- Weak : Boolean := False; + -- Success_Model : Mem_Model := Seq_Cst; + -- Failure_Model : Mem_Model := Seq_Cst) return Boolean; + -- pragma Import (Intrinsic, + -- Atomic_Compare_Exchange_8, + -- "__atomic_compare_exchange_1"); + -------------------------- -- Lock-free operations -- -------------------------- -- 2.30.2