diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2020-01-14 21:56:28 +0100 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2020-06-03 06:01:43 -0400 |
commit | 30c6e576a32bfa132fd57434a80b35b712f05458 (patch) | |
tree | e855d69fd3efa3eeeee3706a687f5170890bdc1d | |
parent | f38efc1361c67077f175f194a34718de85d17a24 (diff) | |
download | gcc-30c6e576a32bfa132fd57434a80b35b712f05458.zip gcc-30c6e576a32bfa132fd57434a80b35b712f05458.tar.gz gcc-30c6e576a32bfa132fd57434a80b35b712f05458.tar.bz2 |
[Ada] Get rid of more references to Universal_Integer in expanded code
2020-06-03 Eric Botcazou <ebotcazou@adacore.com>
gcc/ada/
* libgnat/s-atopar.adb (Atomic_Fetch_And_Add): Make use of an
equivalent static expression.
(Atomic_Fetch_And_Subtract): Likewise.
(Is_Lock_Free): Likewise.
* libgnat/s-atopex.adb (Atomic_Exchange): Likewise.
(Atomic_Compare_And_Exchange): Likewise.
(Is_Lock_Free): Likewise.
-rw-r--r-- | gcc/ada/libgnat/s-atopar.adb | 7 | ||||
-rw-r--r-- | gcc/ada/libgnat/s-atopex.adb | 7 |
2 files changed, 8 insertions, 6 deletions
diff --git a/gcc/ada/libgnat/s-atopar.adb b/gcc/ada/libgnat/s-atopar.adb index 1fad13c..d4590c7 100644 --- a/gcc/ada/libgnat/s-atopar.adb +++ b/gcc/ada/libgnat/s-atopar.adb @@ -88,7 +88,7 @@ package body System.Atomic_Operations.Arithmetic is pragma Warnings (On); begin - case Item'Size is + case Atomic_Type'Size is when 8 => return Atomic_Fetch_Add_1 (Item'Address, Value); when 16 => return Atomic_Fetch_Add_2 (Item'Address, Value); when 32 => return Atomic_Fetch_Add_4 (Item'Address, Value); @@ -125,7 +125,7 @@ package body System.Atomic_Operations.Arithmetic is pragma Warnings (On); begin - case Item'Size is + case Atomic_Type'Size is when 8 => return Atomic_Fetch_Sub_1 (Item'Address, Value); when 16 => return Atomic_Fetch_Sub_2 (Item'Address, Value); when 32 => return Atomic_Fetch_Sub_4 (Item'Address, Value); @@ -139,9 +139,10 @@ package body System.Atomic_Operations.Arithmetic is ------------------ function Is_Lock_Free (Item : aliased Atomic_Type) return Boolean is + pragma Unreferenced (Item); use type Interfaces.C.size_t; begin - return Boolean (Atomic_Always_Lock_Free (Item'Size / 8)); + return Boolean (Atomic_Always_Lock_Free (Atomic_Type'Size / 8)); end Is_Lock_Free; end System.Atomic_Operations.Arithmetic; diff --git a/gcc/ada/libgnat/s-atopex.adb b/gcc/ada/libgnat/s-atopex.adb index b0a6ccc..1c2921f 100644 --- a/gcc/ada/libgnat/s-atopex.adb +++ b/gcc/ada/libgnat/s-atopex.adb @@ -66,7 +66,7 @@ package body System.Atomic_Operations.Exchange is pragma Warnings (On); begin - case Item'Size is + case Atomic_Type'Size is when 8 => return Atomic_Exchange_1 (Item'Address, Value); when 16 => return Atomic_Exchange_2 (Item'Address, Value); when 32 => return Atomic_Exchange_4 (Item'Address, Value); @@ -124,7 +124,7 @@ package body System.Atomic_Operations.Exchange is pragma Warnings (On); begin - case Item'Size is + case Atomic_Type'Size is when 8 => return Boolean (Atomic_Compare_Exchange_1 @@ -151,9 +151,10 @@ package body System.Atomic_Operations.Exchange is ------------------ function Is_Lock_Free (Item : aliased Atomic_Type) return Boolean is + pragma Unreferenced (Item); use type Interfaces.C.size_t; begin - return Boolean (Atomic_Always_Lock_Free (Item'Size / 8)); + return Boolean (Atomic_Always_Lock_Free (Atomic_Type'Size / 8)); end Is_Lock_Free; end System.Atomic_Operations.Exchange; |