From: Arnaud Charlet Date: Mon, 20 Jan 2020 11:07:09 +0000 (-0500) Subject: [Ada] Continuation of "Get rid of more references to Universal_Integer" X-Git-Tag: upstream/12.2.0~16053 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bbe376e136edb8456088d7298d4ba7c93d4e0529;p=platform%2Fupstream%2Fgcc.git [Ada] Continuation of "Get rid of more references to Universal_Integer" 2020-06-04 Arnaud Charlet gcc/ada/ * libgnat/s-atopar.adb, libgnat/s-atopex.adb: Use Object_Size instead of Size, otherwise many derived types will be rejected (e.g. a type with a 14 bits 'Size and a 16 bits 'Object_Size). --- diff --git a/gcc/ada/libgnat/s-atopar.adb b/gcc/ada/libgnat/s-atopar.adb index d4590c7..554561c 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 Atomic_Type'Size is + case Atomic_Type'Object_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 Atomic_Type'Size is + case Atomic_Type'Object_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); @@ -142,7 +142,7 @@ package body System.Atomic_Operations.Arithmetic is pragma Unreferenced (Item); use type Interfaces.C.size_t; begin - return Boolean (Atomic_Always_Lock_Free (Atomic_Type'Size / 8)); + return Boolean (Atomic_Always_Lock_Free (Atomic_Type'Object_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 1c2921f..4fb2824 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 Atomic_Type'Size is + case Atomic_Type'Object_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 Atomic_Type'Size is + case Atomic_Type'Object_Size is when 8 => return Boolean (Atomic_Compare_Exchange_1 @@ -154,7 +154,7 @@ package body System.Atomic_Operations.Exchange is pragma Unreferenced (Item); use type Interfaces.C.size_t; begin - return Boolean (Atomic_Always_Lock_Free (Atomic_Type'Size / 8)); + return Boolean (Atomic_Always_Lock_Free (Atomic_Type'Object_Size / 8)); end Is_Lock_Free; end System.Atomic_Operations.Exchange;