From bbe376e136edb8456088d7298d4ba7c93d4e0529 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Mon, 20 Jan 2020 06:07:09 -0500 Subject: [PATCH] [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). --- gcc/ada/libgnat/s-atopar.adb | 6 +++--- gcc/ada/libgnat/s-atopex.adb | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gcc/ada/libgnat/s-atopar.adb b/gcc/ada/libgnat/s-atopar.adb index d4590c708e8..554561c3468 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 1c2921f9151..4fb28241039 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; -- 2.30.2