diff options
Diffstat (limited to 'gcc/ada')
121 files changed, 2453 insertions, 1432 deletions
diff --git a/gcc/ada/libgnat/s-pack03.adb b/gcc/ada/libgnat/s-pack03.adb index 73f54db..56b036e 100644 --- a/gcc/ada/libgnat/s-pack03.adb +++ b/gcc/ada/libgnat/s-pack03.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_03 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_03 -- @@ -85,9 +90,10 @@ package body System.Pack_03 is N : Natural; Rev_SSO : Boolean) return Bits_03 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_03 is E : Bits_03; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack05.adb b/gcc/ada/libgnat/s-pack05.adb index 48db669..0abccaf9 100644 --- a/gcc/ada/libgnat/s-pack05.adb +++ b/gcc/ada/libgnat/s-pack05.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_05 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_05 -- @@ -85,9 +90,10 @@ package body System.Pack_05 is N : Natural; Rev_SSO : Boolean) return Bits_05 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_05 is E : Bits_05; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack06.adb b/gcc/ada/libgnat/s-pack06.adb index c27412c..3b85634 100644 --- a/gcc/ada/libgnat/s-pack06.adb +++ b/gcc/ada/libgnat/s-pack06.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_06 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); -- The following declarations are for the case where the address -- passed to GetU_06 or SetU_06 is not guaranteed to be aligned. @@ -84,12 +89,13 @@ package body System.Pack_06 is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); ------------ -- Get_06 -- @@ -100,9 +106,10 @@ package body System.Pack_06 is N : Natural; Rev_SSO : Boolean) return Bits_06 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -138,9 +145,10 @@ package body System.Pack_06 is N : Natural; Rev_SSO : Boolean) return Bits_06 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -177,9 +185,10 @@ package body System.Pack_06 is E : Bits_06; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -216,9 +225,10 @@ package body System.Pack_06 is E : Bits_06; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack07.adb b/gcc/ada/libgnat/s-pack07.adb index 159fb21..e93aca5 100644 --- a/gcc/ada/libgnat/s-pack07.adb +++ b/gcc/ada/libgnat/s-pack07.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_07 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_07 -- @@ -85,9 +90,10 @@ package body System.Pack_07 is N : Natural; Rev_SSO : Boolean) return Bits_07 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_07 is E : Bits_07; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack09.adb b/gcc/ada/libgnat/s-pack09.adb index a1fb415..85bc49a 100644 --- a/gcc/ada/libgnat/s-pack09.adb +++ b/gcc/ada/libgnat/s-pack09.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_09 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_09 -- @@ -85,9 +90,10 @@ package body System.Pack_09 is N : Natural; Rev_SSO : Boolean) return Bits_09 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_09 is E : Bits_09; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack10.adb b/gcc/ada/libgnat/s-pack10.adb index 42e1c3a..6bf3ab7 100644 --- a/gcc/ada/libgnat/s-pack10.adb +++ b/gcc/ada/libgnat/s-pack10.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_10 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); -- The following declarations are for the case where the address -- passed to GetU_10 or SetU_10 is not guaranteed to be aligned. @@ -84,12 +89,13 @@ package body System.Pack_10 is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); ------------ -- Get_10 -- @@ -100,9 +106,10 @@ package body System.Pack_10 is N : Natural; Rev_SSO : Boolean) return Bits_10 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -138,9 +145,10 @@ package body System.Pack_10 is N : Natural; Rev_SSO : Boolean) return Bits_10 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -177,9 +185,10 @@ package body System.Pack_10 is E : Bits_10; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -216,9 +225,10 @@ package body System.Pack_10 is E : Bits_10; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack100.adb b/gcc/ada/libgnat/s-pack100.adb index 8429daf..b413f45 100644 --- a/gcc/ada/libgnat/s-pack100.adb +++ b/gcc/ada/libgnat/s-pack100.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_100 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); -- The following declarations are for the case where the address -- passed to GetU_100 or SetU_100 is not guaranteed to be aligned. @@ -84,12 +89,13 @@ package body System.Pack_100 is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); ------------ -- Get_100 -- @@ -100,9 +106,10 @@ package body System.Pack_100 is N : Natural; Rev_SSO : Boolean) return Bits_100 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -138,9 +145,10 @@ package body System.Pack_100 is N : Natural; Rev_SSO : Boolean) return Bits_100 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -177,9 +185,10 @@ package body System.Pack_100 is E : Bits_100; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -216,9 +225,10 @@ package body System.Pack_100 is E : Bits_100; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack101.adb b/gcc/ada/libgnat/s-pack101.adb index eb22abd..5d5fdb3 100644 --- a/gcc/ada/libgnat/s-pack101.adb +++ b/gcc/ada/libgnat/s-pack101.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_101 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_101 -- @@ -85,9 +90,10 @@ package body System.Pack_101 is N : Natural; Rev_SSO : Boolean) return Bits_101 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_101 is E : Bits_101; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack102.adb b/gcc/ada/libgnat/s-pack102.adb index 6ac093c..b00f67b 100644 --- a/gcc/ada/libgnat/s-pack102.adb +++ b/gcc/ada/libgnat/s-pack102.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_102 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); -- The following declarations are for the case where the address -- passed to GetU_102 or SetU_102 is not guaranteed to be aligned. @@ -84,12 +89,13 @@ package body System.Pack_102 is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); ------------ -- Get_102 -- @@ -100,9 +106,10 @@ package body System.Pack_102 is N : Natural; Rev_SSO : Boolean) return Bits_102 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -138,9 +145,10 @@ package body System.Pack_102 is N : Natural; Rev_SSO : Boolean) return Bits_102 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -177,9 +185,10 @@ package body System.Pack_102 is E : Bits_102; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -216,9 +225,10 @@ package body System.Pack_102 is E : Bits_102; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack103.adb b/gcc/ada/libgnat/s-pack103.adb index a51ba94..0839c89 100644 --- a/gcc/ada/libgnat/s-pack103.adb +++ b/gcc/ada/libgnat/s-pack103.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_103 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_103 -- @@ -85,9 +90,10 @@ package body System.Pack_103 is N : Natural; Rev_SSO : Boolean) return Bits_103 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_103 is E : Bits_103; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack104.adb b/gcc/ada/libgnat/s-pack104.adb index 24f5fb4..b3430e5 100644 --- a/gcc/ada/libgnat/s-pack104.adb +++ b/gcc/ada/libgnat/s-pack104.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_104 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); -- The following declarations are for the case where the address -- passed to GetU_104 or SetU_104 is not guaranteed to be aligned. @@ -84,12 +89,13 @@ package body System.Pack_104 is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); ------------ -- Get_104 -- @@ -100,9 +106,10 @@ package body System.Pack_104 is N : Natural; Rev_SSO : Boolean) return Bits_104 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -138,9 +145,10 @@ package body System.Pack_104 is N : Natural; Rev_SSO : Boolean) return Bits_104 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -177,9 +185,10 @@ package body System.Pack_104 is E : Bits_104; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -216,9 +225,10 @@ package body System.Pack_104 is E : Bits_104; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack105.adb b/gcc/ada/libgnat/s-pack105.adb index 5397947..4355aca 100644 --- a/gcc/ada/libgnat/s-pack105.adb +++ b/gcc/ada/libgnat/s-pack105.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_105 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_105 -- @@ -85,9 +90,10 @@ package body System.Pack_105 is N : Natural; Rev_SSO : Boolean) return Bits_105 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_105 is E : Bits_105; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack106.adb b/gcc/ada/libgnat/s-pack106.adb index bd1631e..870ab72 100644 --- a/gcc/ada/libgnat/s-pack106.adb +++ b/gcc/ada/libgnat/s-pack106.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_106 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); -- The following declarations are for the case where the address -- passed to GetU_106 or SetU_106 is not guaranteed to be aligned. @@ -84,12 +89,13 @@ package body System.Pack_106 is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); ------------ -- Get_106 -- @@ -100,9 +106,10 @@ package body System.Pack_106 is N : Natural; Rev_SSO : Boolean) return Bits_106 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -138,9 +145,10 @@ package body System.Pack_106 is N : Natural; Rev_SSO : Boolean) return Bits_106 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -177,9 +185,10 @@ package body System.Pack_106 is E : Bits_106; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -216,9 +225,10 @@ package body System.Pack_106 is E : Bits_106; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack107.adb b/gcc/ada/libgnat/s-pack107.adb index b2e84ac..2266717 100644 --- a/gcc/ada/libgnat/s-pack107.adb +++ b/gcc/ada/libgnat/s-pack107.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_107 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_107 -- @@ -85,9 +90,10 @@ package body System.Pack_107 is N : Natural; Rev_SSO : Boolean) return Bits_107 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_107 is E : Bits_107; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack108.adb b/gcc/ada/libgnat/s-pack108.adb index 2f37e0c..87c8a33 100644 --- a/gcc/ada/libgnat/s-pack108.adb +++ b/gcc/ada/libgnat/s-pack108.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_108 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); -- The following declarations are for the case where the address -- passed to GetU_108 or SetU_108 is not guaranteed to be aligned. @@ -84,12 +89,13 @@ package body System.Pack_108 is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); ------------ -- Get_108 -- @@ -100,9 +106,10 @@ package body System.Pack_108 is N : Natural; Rev_SSO : Boolean) return Bits_108 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -138,9 +145,10 @@ package body System.Pack_108 is N : Natural; Rev_SSO : Boolean) return Bits_108 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -177,9 +185,10 @@ package body System.Pack_108 is E : Bits_108; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -216,9 +225,10 @@ package body System.Pack_108 is E : Bits_108; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack109.adb b/gcc/ada/libgnat/s-pack109.adb index a227b27..278d206 100644 --- a/gcc/ada/libgnat/s-pack109.adb +++ b/gcc/ada/libgnat/s-pack109.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_109 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_109 -- @@ -85,9 +90,10 @@ package body System.Pack_109 is N : Natural; Rev_SSO : Boolean) return Bits_109 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_109 is E : Bits_109; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack11.adb b/gcc/ada/libgnat/s-pack11.adb index 4b227e9..61312ce 100644 --- a/gcc/ada/libgnat/s-pack11.adb +++ b/gcc/ada/libgnat/s-pack11.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_11 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_11 -- @@ -85,9 +90,10 @@ package body System.Pack_11 is N : Natural; Rev_SSO : Boolean) return Bits_11 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_11 is E : Bits_11; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack110.adb b/gcc/ada/libgnat/s-pack110.adb index a6ae71b..40c5884 100644 --- a/gcc/ada/libgnat/s-pack110.adb +++ b/gcc/ada/libgnat/s-pack110.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_110 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); -- The following declarations are for the case where the address -- passed to GetU_110 or SetU_110 is not guaranteed to be aligned. @@ -84,12 +89,13 @@ package body System.Pack_110 is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); ------------ -- Get_110 -- @@ -100,9 +106,10 @@ package body System.Pack_110 is N : Natural; Rev_SSO : Boolean) return Bits_110 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -138,9 +145,10 @@ package body System.Pack_110 is N : Natural; Rev_SSO : Boolean) return Bits_110 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -177,9 +185,10 @@ package body System.Pack_110 is E : Bits_110; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -216,9 +225,10 @@ package body System.Pack_110 is E : Bits_110; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack111.adb b/gcc/ada/libgnat/s-pack111.adb index d0068d2..4b4e5b4 100644 --- a/gcc/ada/libgnat/s-pack111.adb +++ b/gcc/ada/libgnat/s-pack111.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_111 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_111 -- @@ -85,9 +90,10 @@ package body System.Pack_111 is N : Natural; Rev_SSO : Boolean) return Bits_111 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_111 is E : Bits_111; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack112.adb b/gcc/ada/libgnat/s-pack112.adb index fe3b6080..16dedbc 100644 --- a/gcc/ada/libgnat/s-pack112.adb +++ b/gcc/ada/libgnat/s-pack112.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_112 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); -- The following declarations are for the case where the address -- passed to GetU_112 or SetU_112 is not guaranteed to be aligned. @@ -84,12 +89,13 @@ package body System.Pack_112 is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); ------------ -- Get_112 -- @@ -100,9 +106,10 @@ package body System.Pack_112 is N : Natural; Rev_SSO : Boolean) return Bits_112 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -138,9 +145,10 @@ package body System.Pack_112 is N : Natural; Rev_SSO : Boolean) return Bits_112 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -177,9 +185,10 @@ package body System.Pack_112 is E : Bits_112; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -216,9 +225,10 @@ package body System.Pack_112 is E : Bits_112; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack113.adb b/gcc/ada/libgnat/s-pack113.adb index 7430264..4376c2a 100644 --- a/gcc/ada/libgnat/s-pack113.adb +++ b/gcc/ada/libgnat/s-pack113.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_113 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_113 -- @@ -85,9 +90,10 @@ package body System.Pack_113 is N : Natural; Rev_SSO : Boolean) return Bits_113 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_113 is E : Bits_113; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack114.adb b/gcc/ada/libgnat/s-pack114.adb index f0bdba2..7d0d4c6 100644 --- a/gcc/ada/libgnat/s-pack114.adb +++ b/gcc/ada/libgnat/s-pack114.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_114 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); -- The following declarations are for the case where the address -- passed to GetU_114 or SetU_114 is not guaranteed to be aligned. @@ -84,12 +89,13 @@ package body System.Pack_114 is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); ------------ -- Get_114 -- @@ -100,9 +106,10 @@ package body System.Pack_114 is N : Natural; Rev_SSO : Boolean) return Bits_114 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -138,9 +145,10 @@ package body System.Pack_114 is N : Natural; Rev_SSO : Boolean) return Bits_114 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -177,9 +185,10 @@ package body System.Pack_114 is E : Bits_114; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -216,9 +225,10 @@ package body System.Pack_114 is E : Bits_114; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack115.adb b/gcc/ada/libgnat/s-pack115.adb index ba6448a..ccca0e7 100644 --- a/gcc/ada/libgnat/s-pack115.adb +++ b/gcc/ada/libgnat/s-pack115.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_115 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_115 -- @@ -85,9 +90,10 @@ package body System.Pack_115 is N : Natural; Rev_SSO : Boolean) return Bits_115 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_115 is E : Bits_115; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack116.adb b/gcc/ada/libgnat/s-pack116.adb index 9fa7645..4787e6a 100644 --- a/gcc/ada/libgnat/s-pack116.adb +++ b/gcc/ada/libgnat/s-pack116.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_116 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); -- The following declarations are for the case where the address -- passed to GetU_116 or SetU_116 is not guaranteed to be aligned. @@ -84,12 +89,13 @@ package body System.Pack_116 is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); ------------ -- Get_116 -- @@ -100,9 +106,10 @@ package body System.Pack_116 is N : Natural; Rev_SSO : Boolean) return Bits_116 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -138,9 +145,10 @@ package body System.Pack_116 is N : Natural; Rev_SSO : Boolean) return Bits_116 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -177,9 +185,10 @@ package body System.Pack_116 is E : Bits_116; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -216,9 +225,10 @@ package body System.Pack_116 is E : Bits_116; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack117.adb b/gcc/ada/libgnat/s-pack117.adb index e9be244..b6940d1 100644 --- a/gcc/ada/libgnat/s-pack117.adb +++ b/gcc/ada/libgnat/s-pack117.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_117 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_117 -- @@ -85,9 +90,10 @@ package body System.Pack_117 is N : Natural; Rev_SSO : Boolean) return Bits_117 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_117 is E : Bits_117; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack118.adb b/gcc/ada/libgnat/s-pack118.adb index 4290e0d..85aa2d5 100644 --- a/gcc/ada/libgnat/s-pack118.adb +++ b/gcc/ada/libgnat/s-pack118.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_118 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); -- The following declarations are for the case where the address -- passed to GetU_118 or SetU_118 is not guaranteed to be aligned. @@ -84,12 +89,13 @@ package body System.Pack_118 is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); ------------ -- Get_118 -- @@ -100,9 +106,10 @@ package body System.Pack_118 is N : Natural; Rev_SSO : Boolean) return Bits_118 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -138,9 +145,10 @@ package body System.Pack_118 is N : Natural; Rev_SSO : Boolean) return Bits_118 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -177,9 +185,10 @@ package body System.Pack_118 is E : Bits_118; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -216,9 +225,10 @@ package body System.Pack_118 is E : Bits_118; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack119.adb b/gcc/ada/libgnat/s-pack119.adb index dd27b4c..5351727 100644 --- a/gcc/ada/libgnat/s-pack119.adb +++ b/gcc/ada/libgnat/s-pack119.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_119 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_119 -- @@ -85,9 +90,10 @@ package body System.Pack_119 is N : Natural; Rev_SSO : Boolean) return Bits_119 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_119 is E : Bits_119; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack12.adb b/gcc/ada/libgnat/s-pack12.adb index 8ae52d2..6ff08c2 100644 --- a/gcc/ada/libgnat/s-pack12.adb +++ b/gcc/ada/libgnat/s-pack12.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_12 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); -- The following declarations are for the case where the address -- passed to GetU_12 or SetU_12 is not guaranteed to be aligned. @@ -84,12 +89,13 @@ package body System.Pack_12 is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); ------------ -- Get_12 -- @@ -100,9 +106,10 @@ package body System.Pack_12 is N : Natural; Rev_SSO : Boolean) return Bits_12 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -138,9 +145,10 @@ package body System.Pack_12 is N : Natural; Rev_SSO : Boolean) return Bits_12 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -177,9 +185,10 @@ package body System.Pack_12 is E : Bits_12; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -216,9 +225,10 @@ package body System.Pack_12 is E : Bits_12; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack120.adb b/gcc/ada/libgnat/s-pack120.adb index fdea3af..9ba9099 100644 --- a/gcc/ada/libgnat/s-pack120.adb +++ b/gcc/ada/libgnat/s-pack120.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_120 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); -- The following declarations are for the case where the address -- passed to GetU_120 or SetU_120 is not guaranteed to be aligned. @@ -84,12 +89,13 @@ package body System.Pack_120 is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); ------------ -- Get_120 -- @@ -100,9 +106,10 @@ package body System.Pack_120 is N : Natural; Rev_SSO : Boolean) return Bits_120 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -138,9 +145,10 @@ package body System.Pack_120 is N : Natural; Rev_SSO : Boolean) return Bits_120 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -177,9 +185,10 @@ package body System.Pack_120 is E : Bits_120; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -216,9 +225,10 @@ package body System.Pack_120 is E : Bits_120; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack121.adb b/gcc/ada/libgnat/s-pack121.adb index 706801e..c876c8d 100644 --- a/gcc/ada/libgnat/s-pack121.adb +++ b/gcc/ada/libgnat/s-pack121.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_121 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_121 -- @@ -85,9 +90,10 @@ package body System.Pack_121 is N : Natural; Rev_SSO : Boolean) return Bits_121 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_121 is E : Bits_121; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack122.adb b/gcc/ada/libgnat/s-pack122.adb index 7ee763f..b118041 100644 --- a/gcc/ada/libgnat/s-pack122.adb +++ b/gcc/ada/libgnat/s-pack122.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_122 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); -- The following declarations are for the case where the address -- passed to GetU_122 or SetU_122 is not guaranteed to be aligned. @@ -84,12 +89,13 @@ package body System.Pack_122 is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); ------------ -- Get_122 -- @@ -100,9 +106,10 @@ package body System.Pack_122 is N : Natural; Rev_SSO : Boolean) return Bits_122 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -138,9 +145,10 @@ package body System.Pack_122 is N : Natural; Rev_SSO : Boolean) return Bits_122 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -177,9 +185,10 @@ package body System.Pack_122 is E : Bits_122; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -216,9 +225,10 @@ package body System.Pack_122 is E : Bits_122; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack123.adb b/gcc/ada/libgnat/s-pack123.adb index a26123e..db6ee28 100644 --- a/gcc/ada/libgnat/s-pack123.adb +++ b/gcc/ada/libgnat/s-pack123.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_123 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_123 -- @@ -85,9 +90,10 @@ package body System.Pack_123 is N : Natural; Rev_SSO : Boolean) return Bits_123 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_123 is E : Bits_123; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack124.adb b/gcc/ada/libgnat/s-pack124.adb index e3f1ae3..8973af1 100644 --- a/gcc/ada/libgnat/s-pack124.adb +++ b/gcc/ada/libgnat/s-pack124.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_124 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); -- The following declarations are for the case where the address -- passed to GetU_124 or SetU_124 is not guaranteed to be aligned. @@ -84,12 +89,13 @@ package body System.Pack_124 is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); ------------ -- Get_124 -- @@ -100,9 +106,10 @@ package body System.Pack_124 is N : Natural; Rev_SSO : Boolean) return Bits_124 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -138,9 +145,10 @@ package body System.Pack_124 is N : Natural; Rev_SSO : Boolean) return Bits_124 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -177,9 +185,10 @@ package body System.Pack_124 is E : Bits_124; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -216,9 +225,10 @@ package body System.Pack_124 is E : Bits_124; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack125.adb b/gcc/ada/libgnat/s-pack125.adb index 86137f6..cd5e77e 100644 --- a/gcc/ada/libgnat/s-pack125.adb +++ b/gcc/ada/libgnat/s-pack125.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_125 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_125 -- @@ -85,9 +90,10 @@ package body System.Pack_125 is N : Natural; Rev_SSO : Boolean) return Bits_125 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_125 is E : Bits_125; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack126.adb b/gcc/ada/libgnat/s-pack126.adb index a984639..3aa0b24 100644 --- a/gcc/ada/libgnat/s-pack126.adb +++ b/gcc/ada/libgnat/s-pack126.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_126 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); -- The following declarations are for the case where the address -- passed to GetU_126 or SetU_126 is not guaranteed to be aligned. @@ -84,12 +89,13 @@ package body System.Pack_126 is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); ------------ -- Get_126 -- @@ -100,9 +106,10 @@ package body System.Pack_126 is N : Natural; Rev_SSO : Boolean) return Bits_126 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -138,9 +145,10 @@ package body System.Pack_126 is N : Natural; Rev_SSO : Boolean) return Bits_126 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -177,9 +185,10 @@ package body System.Pack_126 is E : Bits_126; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -216,9 +225,10 @@ package body System.Pack_126 is E : Bits_126; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack127.adb b/gcc/ada/libgnat/s-pack127.adb index 2cc7040..f85591e 100644 --- a/gcc/ada/libgnat/s-pack127.adb +++ b/gcc/ada/libgnat/s-pack127.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_127 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_127 -- @@ -85,9 +90,10 @@ package body System.Pack_127 is N : Natural; Rev_SSO : Boolean) return Bits_127 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_127 is E : Bits_127; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack13.adb b/gcc/ada/libgnat/s-pack13.adb index 3cb510b..0623f9a 100644 --- a/gcc/ada/libgnat/s-pack13.adb +++ b/gcc/ada/libgnat/s-pack13.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_13 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_13 -- @@ -85,9 +90,10 @@ package body System.Pack_13 is N : Natural; Rev_SSO : Boolean) return Bits_13 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_13 is E : Bits_13; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack14.adb b/gcc/ada/libgnat/s-pack14.adb index 56e8ab9..c769d97 100644 --- a/gcc/ada/libgnat/s-pack14.adb +++ b/gcc/ada/libgnat/s-pack14.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_14 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); -- The following declarations are for the case where the address -- passed to GetU_14 or SetU_14 is not guaranteed to be aligned. @@ -84,12 +89,13 @@ package body System.Pack_14 is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); ------------ -- Get_14 -- @@ -100,9 +106,10 @@ package body System.Pack_14 is N : Natural; Rev_SSO : Boolean) return Bits_14 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -138,9 +145,10 @@ package body System.Pack_14 is N : Natural; Rev_SSO : Boolean) return Bits_14 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -177,9 +185,10 @@ package body System.Pack_14 is E : Bits_14; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -216,9 +225,10 @@ package body System.Pack_14 is E : Bits_14; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack15.adb b/gcc/ada/libgnat/s-pack15.adb index f4dcc74..70ff0f1 100644 --- a/gcc/ada/libgnat/s-pack15.adb +++ b/gcc/ada/libgnat/s-pack15.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_15 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_15 -- @@ -85,9 +90,10 @@ package body System.Pack_15 is N : Natural; Rev_SSO : Boolean) return Bits_15 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_15 is E : Bits_15; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack17.adb b/gcc/ada/libgnat/s-pack17.adb index fbecd15..5347d0a 100644 --- a/gcc/ada/libgnat/s-pack17.adb +++ b/gcc/ada/libgnat/s-pack17.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_17 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_17 -- @@ -85,9 +90,10 @@ package body System.Pack_17 is N : Natural; Rev_SSO : Boolean) return Bits_17 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_17 is E : Bits_17; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack18.adb b/gcc/ada/libgnat/s-pack18.adb index 0a19393..b8a907c 100644 --- a/gcc/ada/libgnat/s-pack18.adb +++ b/gcc/ada/libgnat/s-pack18.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_18 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); -- The following declarations are for the case where the address -- passed to GetU_18 or SetU_18 is not guaranteed to be aligned. @@ -84,12 +89,13 @@ package body System.Pack_18 is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); ------------ -- Get_18 -- @@ -100,9 +106,10 @@ package body System.Pack_18 is N : Natural; Rev_SSO : Boolean) return Bits_18 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -138,9 +145,10 @@ package body System.Pack_18 is N : Natural; Rev_SSO : Boolean) return Bits_18 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -177,9 +185,10 @@ package body System.Pack_18 is E : Bits_18; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -216,9 +225,10 @@ package body System.Pack_18 is E : Bits_18; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack19.adb b/gcc/ada/libgnat/s-pack19.adb index 2fc2c69..5185380 100644 --- a/gcc/ada/libgnat/s-pack19.adb +++ b/gcc/ada/libgnat/s-pack19.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_19 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_19 -- @@ -85,9 +90,10 @@ package body System.Pack_19 is N : Natural; Rev_SSO : Boolean) return Bits_19 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_19 is E : Bits_19; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack20.adb b/gcc/ada/libgnat/s-pack20.adb index 678931d..b5e0a67 100644 --- a/gcc/ada/libgnat/s-pack20.adb +++ b/gcc/ada/libgnat/s-pack20.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_20 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); -- The following declarations are for the case where the address -- passed to GetU_20 or SetU_20 is not guaranteed to be aligned. @@ -84,12 +89,13 @@ package body System.Pack_20 is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); ------------ -- Get_20 -- @@ -100,9 +106,10 @@ package body System.Pack_20 is N : Natural; Rev_SSO : Boolean) return Bits_20 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -138,9 +145,10 @@ package body System.Pack_20 is N : Natural; Rev_SSO : Boolean) return Bits_20 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -177,9 +185,10 @@ package body System.Pack_20 is E : Bits_20; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -216,9 +225,10 @@ package body System.Pack_20 is E : Bits_20; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack21.adb b/gcc/ada/libgnat/s-pack21.adb index b55e835..8b98af8 100644 --- a/gcc/ada/libgnat/s-pack21.adb +++ b/gcc/ada/libgnat/s-pack21.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_21 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_21 -- @@ -85,9 +90,10 @@ package body System.Pack_21 is N : Natural; Rev_SSO : Boolean) return Bits_21 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_21 is E : Bits_21; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack22.adb b/gcc/ada/libgnat/s-pack22.adb index 91cd46f..14e5226 100644 --- a/gcc/ada/libgnat/s-pack22.adb +++ b/gcc/ada/libgnat/s-pack22.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_22 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); -- The following declarations are for the case where the address -- passed to GetU_22 or SetU_22 is not guaranteed to be aligned. @@ -84,12 +89,13 @@ package body System.Pack_22 is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); ------------ -- Get_22 -- @@ -100,9 +106,10 @@ package body System.Pack_22 is N : Natural; Rev_SSO : Boolean) return Bits_22 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -138,9 +145,10 @@ package body System.Pack_22 is N : Natural; Rev_SSO : Boolean) return Bits_22 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -177,9 +185,10 @@ package body System.Pack_22 is E : Bits_22; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -216,9 +225,10 @@ package body System.Pack_22 is E : Bits_22; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack23.adb b/gcc/ada/libgnat/s-pack23.adb index 9dc2450..7284a1b 100644 --- a/gcc/ada/libgnat/s-pack23.adb +++ b/gcc/ada/libgnat/s-pack23.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_23 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_23 -- @@ -85,9 +90,10 @@ package body System.Pack_23 is N : Natural; Rev_SSO : Boolean) return Bits_23 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_23 is E : Bits_23; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack24.adb b/gcc/ada/libgnat/s-pack24.adb index 27c3c9d..b2c2a62 100644 --- a/gcc/ada/libgnat/s-pack24.adb +++ b/gcc/ada/libgnat/s-pack24.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_24 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); -- The following declarations are for the case where the address -- passed to GetU_24 or SetU_24 is not guaranteed to be aligned. @@ -84,12 +89,13 @@ package body System.Pack_24 is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); ------------ -- Get_24 -- @@ -100,9 +106,10 @@ package body System.Pack_24 is N : Natural; Rev_SSO : Boolean) return Bits_24 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -138,9 +145,10 @@ package body System.Pack_24 is N : Natural; Rev_SSO : Boolean) return Bits_24 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -177,9 +185,10 @@ package body System.Pack_24 is E : Bits_24; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -216,9 +225,10 @@ package body System.Pack_24 is E : Bits_24; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack25.adb b/gcc/ada/libgnat/s-pack25.adb index 2a6ce35..dd473d2 100644 --- a/gcc/ada/libgnat/s-pack25.adb +++ b/gcc/ada/libgnat/s-pack25.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_25 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_25 -- @@ -85,9 +90,10 @@ package body System.Pack_25 is N : Natural; Rev_SSO : Boolean) return Bits_25 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_25 is E : Bits_25; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack26.adb b/gcc/ada/libgnat/s-pack26.adb index f764b48..4a682b5 100644 --- a/gcc/ada/libgnat/s-pack26.adb +++ b/gcc/ada/libgnat/s-pack26.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_26 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); -- The following declarations are for the case where the address -- passed to GetU_26 or SetU_26 is not guaranteed to be aligned. @@ -84,12 +89,13 @@ package body System.Pack_26 is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); ------------ -- Get_26 -- @@ -100,9 +106,10 @@ package body System.Pack_26 is N : Natural; Rev_SSO : Boolean) return Bits_26 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -138,9 +145,10 @@ package body System.Pack_26 is N : Natural; Rev_SSO : Boolean) return Bits_26 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -177,9 +185,10 @@ package body System.Pack_26 is E : Bits_26; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -216,9 +225,10 @@ package body System.Pack_26 is E : Bits_26; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack27.adb b/gcc/ada/libgnat/s-pack27.adb index 23d12b0..c0bc771 100644 --- a/gcc/ada/libgnat/s-pack27.adb +++ b/gcc/ada/libgnat/s-pack27.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_27 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_27 -- @@ -85,9 +90,10 @@ package body System.Pack_27 is N : Natural; Rev_SSO : Boolean) return Bits_27 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_27 is E : Bits_27; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack28.adb b/gcc/ada/libgnat/s-pack28.adb index d2c2efb..be27c0e 100644 --- a/gcc/ada/libgnat/s-pack28.adb +++ b/gcc/ada/libgnat/s-pack28.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_28 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); -- The following declarations are for the case where the address -- passed to GetU_28 or SetU_28 is not guaranteed to be aligned. @@ -84,12 +89,13 @@ package body System.Pack_28 is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); ------------ -- Get_28 -- @@ -100,9 +106,10 @@ package body System.Pack_28 is N : Natural; Rev_SSO : Boolean) return Bits_28 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -138,9 +145,10 @@ package body System.Pack_28 is N : Natural; Rev_SSO : Boolean) return Bits_28 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -177,9 +185,10 @@ package body System.Pack_28 is E : Bits_28; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -216,9 +225,10 @@ package body System.Pack_28 is E : Bits_28; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack29.adb b/gcc/ada/libgnat/s-pack29.adb index 0212843..2254b90 100644 --- a/gcc/ada/libgnat/s-pack29.adb +++ b/gcc/ada/libgnat/s-pack29.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_29 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_29 -- @@ -85,9 +90,10 @@ package body System.Pack_29 is N : Natural; Rev_SSO : Boolean) return Bits_29 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_29 is E : Bits_29; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack30.adb b/gcc/ada/libgnat/s-pack30.adb index 0f313f3..fa48a0a 100644 --- a/gcc/ada/libgnat/s-pack30.adb +++ b/gcc/ada/libgnat/s-pack30.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_30 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); -- The following declarations are for the case where the address -- passed to GetU_30 or SetU_30 is not guaranteed to be aligned. @@ -84,12 +89,13 @@ package body System.Pack_30 is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); ------------ -- Get_30 -- @@ -100,9 +106,10 @@ package body System.Pack_30 is N : Natural; Rev_SSO : Boolean) return Bits_30 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -138,9 +145,10 @@ package body System.Pack_30 is N : Natural; Rev_SSO : Boolean) return Bits_30 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -177,9 +185,10 @@ package body System.Pack_30 is E : Bits_30; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -216,9 +225,10 @@ package body System.Pack_30 is E : Bits_30; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack31.adb b/gcc/ada/libgnat/s-pack31.adb index 958bca7..3234d43 100644 --- a/gcc/ada/libgnat/s-pack31.adb +++ b/gcc/ada/libgnat/s-pack31.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_31 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_31 -- @@ -85,9 +90,10 @@ package body System.Pack_31 is N : Natural; Rev_SSO : Boolean) return Bits_31 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_31 is E : Bits_31; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack33.adb b/gcc/ada/libgnat/s-pack33.adb index 6cf9d5c..4b0aae8 100644 --- a/gcc/ada/libgnat/s-pack33.adb +++ b/gcc/ada/libgnat/s-pack33.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_33 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_33 -- @@ -85,9 +90,10 @@ package body System.Pack_33 is N : Natural; Rev_SSO : Boolean) return Bits_33 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_33 is E : Bits_33; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack34.adb b/gcc/ada/libgnat/s-pack34.adb index a63451b..2f8a348 100644 --- a/gcc/ada/libgnat/s-pack34.adb +++ b/gcc/ada/libgnat/s-pack34.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_34 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); -- The following declarations are for the case where the address -- passed to GetU_34 or SetU_34 is not guaranteed to be aligned. @@ -84,12 +89,13 @@ package body System.Pack_34 is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); ------------ -- Get_34 -- @@ -100,9 +106,10 @@ package body System.Pack_34 is N : Natural; Rev_SSO : Boolean) return Bits_34 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -138,9 +145,10 @@ package body System.Pack_34 is N : Natural; Rev_SSO : Boolean) return Bits_34 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -177,9 +185,10 @@ package body System.Pack_34 is E : Bits_34; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -216,9 +225,10 @@ package body System.Pack_34 is E : Bits_34; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack35.adb b/gcc/ada/libgnat/s-pack35.adb index 36d011f..82608e1 100644 --- a/gcc/ada/libgnat/s-pack35.adb +++ b/gcc/ada/libgnat/s-pack35.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_35 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_35 -- @@ -85,9 +90,10 @@ package body System.Pack_35 is N : Natural; Rev_SSO : Boolean) return Bits_35 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_35 is E : Bits_35; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack36.adb b/gcc/ada/libgnat/s-pack36.adb index a137c3b..b395568 100644 --- a/gcc/ada/libgnat/s-pack36.adb +++ b/gcc/ada/libgnat/s-pack36.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_36 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); -- The following declarations are for the case where the address -- passed to GetU_36 or SetU_36 is not guaranteed to be aligned. @@ -84,12 +89,13 @@ package body System.Pack_36 is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); ------------ -- Get_36 -- @@ -100,9 +106,10 @@ package body System.Pack_36 is N : Natural; Rev_SSO : Boolean) return Bits_36 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -138,9 +145,10 @@ package body System.Pack_36 is N : Natural; Rev_SSO : Boolean) return Bits_36 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -177,9 +185,10 @@ package body System.Pack_36 is E : Bits_36; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -216,9 +225,10 @@ package body System.Pack_36 is E : Bits_36; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack37.adb b/gcc/ada/libgnat/s-pack37.adb index 72ec4c6..0f46635 100644 --- a/gcc/ada/libgnat/s-pack37.adb +++ b/gcc/ada/libgnat/s-pack37.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_37 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_37 -- @@ -85,9 +90,10 @@ package body System.Pack_37 is N : Natural; Rev_SSO : Boolean) return Bits_37 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_37 is E : Bits_37; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack38.adb b/gcc/ada/libgnat/s-pack38.adb index 6ea9a67..97303c9 100644 --- a/gcc/ada/libgnat/s-pack38.adb +++ b/gcc/ada/libgnat/s-pack38.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_38 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); -- The following declarations are for the case where the address -- passed to GetU_38 or SetU_38 is not guaranteed to be aligned. @@ -84,12 +89,13 @@ package body System.Pack_38 is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); ------------ -- Get_38 -- @@ -100,9 +106,10 @@ package body System.Pack_38 is N : Natural; Rev_SSO : Boolean) return Bits_38 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -138,9 +145,10 @@ package body System.Pack_38 is N : Natural; Rev_SSO : Boolean) return Bits_38 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -177,9 +185,10 @@ package body System.Pack_38 is E : Bits_38; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -216,9 +225,10 @@ package body System.Pack_38 is E : Bits_38; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack39.adb b/gcc/ada/libgnat/s-pack39.adb index 75747c5..e712ba0 100644 --- a/gcc/ada/libgnat/s-pack39.adb +++ b/gcc/ada/libgnat/s-pack39.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_39 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_39 -- @@ -85,9 +90,10 @@ package body System.Pack_39 is N : Natural; Rev_SSO : Boolean) return Bits_39 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_39 is E : Bits_39; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack40.adb b/gcc/ada/libgnat/s-pack40.adb index 383c54e..44d8aa4 100644 --- a/gcc/ada/libgnat/s-pack40.adb +++ b/gcc/ada/libgnat/s-pack40.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_40 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); -- The following declarations are for the case where the address -- passed to GetU_40 or SetU_40 is not guaranteed to be aligned. @@ -84,12 +89,13 @@ package body System.Pack_40 is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); ------------ -- Get_40 -- @@ -100,9 +106,10 @@ package body System.Pack_40 is N : Natural; Rev_SSO : Boolean) return Bits_40 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -138,9 +145,10 @@ package body System.Pack_40 is N : Natural; Rev_SSO : Boolean) return Bits_40 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -177,9 +185,10 @@ package body System.Pack_40 is E : Bits_40; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -216,9 +225,10 @@ package body System.Pack_40 is E : Bits_40; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack41.adb b/gcc/ada/libgnat/s-pack41.adb index 23849be..cb7378a 100644 --- a/gcc/ada/libgnat/s-pack41.adb +++ b/gcc/ada/libgnat/s-pack41.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_41 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_41 -- @@ -85,9 +90,10 @@ package body System.Pack_41 is N : Natural; Rev_SSO : Boolean) return Bits_41 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_41 is E : Bits_41; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack42.adb b/gcc/ada/libgnat/s-pack42.adb index b90fe03..96b3881 100644 --- a/gcc/ada/libgnat/s-pack42.adb +++ b/gcc/ada/libgnat/s-pack42.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_42 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); -- The following declarations are for the case where the address -- passed to GetU_42 or SetU_42 is not guaranteed to be aligned. @@ -84,12 +89,13 @@ package body System.Pack_42 is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); ------------ -- Get_42 -- @@ -100,9 +106,10 @@ package body System.Pack_42 is N : Natural; Rev_SSO : Boolean) return Bits_42 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -138,9 +145,10 @@ package body System.Pack_42 is N : Natural; Rev_SSO : Boolean) return Bits_42 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -177,9 +185,10 @@ package body System.Pack_42 is E : Bits_42; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -216,9 +225,10 @@ package body System.Pack_42 is E : Bits_42; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack43.adb b/gcc/ada/libgnat/s-pack43.adb index f97e2a5..eb59a37 100644 --- a/gcc/ada/libgnat/s-pack43.adb +++ b/gcc/ada/libgnat/s-pack43.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_43 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_43 -- @@ -85,9 +90,10 @@ package body System.Pack_43 is N : Natural; Rev_SSO : Boolean) return Bits_43 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_43 is E : Bits_43; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack44.adb b/gcc/ada/libgnat/s-pack44.adb index 4f61909..f11db44 100644 --- a/gcc/ada/libgnat/s-pack44.adb +++ b/gcc/ada/libgnat/s-pack44.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_44 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); -- The following declarations are for the case where the address -- passed to GetU_44 or SetU_44 is not guaranteed to be aligned. @@ -84,12 +89,13 @@ package body System.Pack_44 is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); ------------ -- Get_44 -- @@ -100,9 +106,10 @@ package body System.Pack_44 is N : Natural; Rev_SSO : Boolean) return Bits_44 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -138,9 +145,10 @@ package body System.Pack_44 is N : Natural; Rev_SSO : Boolean) return Bits_44 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -177,9 +185,10 @@ package body System.Pack_44 is E : Bits_44; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -216,9 +225,10 @@ package body System.Pack_44 is E : Bits_44; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack45.adb b/gcc/ada/libgnat/s-pack45.adb index d67fbae..a880615 100644 --- a/gcc/ada/libgnat/s-pack45.adb +++ b/gcc/ada/libgnat/s-pack45.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_45 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_45 -- @@ -85,9 +90,10 @@ package body System.Pack_45 is N : Natural; Rev_SSO : Boolean) return Bits_45 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_45 is E : Bits_45; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack46.adb b/gcc/ada/libgnat/s-pack46.adb index e5b86bd..586e97a 100644 --- a/gcc/ada/libgnat/s-pack46.adb +++ b/gcc/ada/libgnat/s-pack46.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_46 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); -- The following declarations are for the case where the address -- passed to GetU_46 or SetU_46 is not guaranteed to be aligned. @@ -84,12 +89,13 @@ package body System.Pack_46 is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); ------------ -- Get_46 -- @@ -100,9 +106,10 @@ package body System.Pack_46 is N : Natural; Rev_SSO : Boolean) return Bits_46 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -138,9 +145,10 @@ package body System.Pack_46 is N : Natural; Rev_SSO : Boolean) return Bits_46 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -177,9 +185,10 @@ package body System.Pack_46 is E : Bits_46; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -216,9 +225,10 @@ package body System.Pack_46 is E : Bits_46; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack47.adb b/gcc/ada/libgnat/s-pack47.adb index c77105c..d315c81 100644 --- a/gcc/ada/libgnat/s-pack47.adb +++ b/gcc/ada/libgnat/s-pack47.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_47 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_47 -- @@ -85,9 +90,10 @@ package body System.Pack_47 is N : Natural; Rev_SSO : Boolean) return Bits_47 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_47 is E : Bits_47; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack48.adb b/gcc/ada/libgnat/s-pack48.adb index ca6a594..247af83 100644 --- a/gcc/ada/libgnat/s-pack48.adb +++ b/gcc/ada/libgnat/s-pack48.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_48 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); -- The following declarations are for the case where the address -- passed to GetU_48 or SetU_48 is not guaranteed to be aligned. @@ -84,12 +89,13 @@ package body System.Pack_48 is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); ------------ -- Get_48 -- @@ -100,9 +106,10 @@ package body System.Pack_48 is N : Natural; Rev_SSO : Boolean) return Bits_48 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -138,9 +145,10 @@ package body System.Pack_48 is N : Natural; Rev_SSO : Boolean) return Bits_48 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -177,9 +185,10 @@ package body System.Pack_48 is E : Bits_48; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -216,9 +225,10 @@ package body System.Pack_48 is E : Bits_48; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack49.adb b/gcc/ada/libgnat/s-pack49.adb index 14b47b4..a054313 100644 --- a/gcc/ada/libgnat/s-pack49.adb +++ b/gcc/ada/libgnat/s-pack49.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_49 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_49 -- @@ -85,9 +90,10 @@ package body System.Pack_49 is N : Natural; Rev_SSO : Boolean) return Bits_49 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_49 is E : Bits_49; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack50.adb b/gcc/ada/libgnat/s-pack50.adb index c748e2b..c03c0cf2 100644 --- a/gcc/ada/libgnat/s-pack50.adb +++ b/gcc/ada/libgnat/s-pack50.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_50 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); -- The following declarations are for the case where the address -- passed to GetU_50 or SetU_50 is not guaranteed to be aligned. @@ -84,12 +89,13 @@ package body System.Pack_50 is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); ------------ -- Get_50 -- @@ -100,9 +106,10 @@ package body System.Pack_50 is N : Natural; Rev_SSO : Boolean) return Bits_50 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -138,9 +145,10 @@ package body System.Pack_50 is N : Natural; Rev_SSO : Boolean) return Bits_50 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -177,9 +185,10 @@ package body System.Pack_50 is E : Bits_50; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -216,9 +225,10 @@ package body System.Pack_50 is E : Bits_50; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack51.adb b/gcc/ada/libgnat/s-pack51.adb index 5c203fa..46abe28 100644 --- a/gcc/ada/libgnat/s-pack51.adb +++ b/gcc/ada/libgnat/s-pack51.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_51 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_51 -- @@ -85,9 +90,10 @@ package body System.Pack_51 is N : Natural; Rev_SSO : Boolean) return Bits_51 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_51 is E : Bits_51; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack52.adb b/gcc/ada/libgnat/s-pack52.adb index 2aeb2f9..6cae3f7 100644 --- a/gcc/ada/libgnat/s-pack52.adb +++ b/gcc/ada/libgnat/s-pack52.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_52 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); -- The following declarations are for the case where the address -- passed to GetU_52 or SetU_52 is not guaranteed to be aligned. @@ -84,12 +89,13 @@ package body System.Pack_52 is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); ------------ -- Get_52 -- @@ -100,9 +106,10 @@ package body System.Pack_52 is N : Natural; Rev_SSO : Boolean) return Bits_52 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -138,9 +145,10 @@ package body System.Pack_52 is N : Natural; Rev_SSO : Boolean) return Bits_52 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -177,9 +185,10 @@ package body System.Pack_52 is E : Bits_52; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -216,9 +225,10 @@ package body System.Pack_52 is E : Bits_52; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack53.adb b/gcc/ada/libgnat/s-pack53.adb index 18e12e2..6a51fa6 100644 --- a/gcc/ada/libgnat/s-pack53.adb +++ b/gcc/ada/libgnat/s-pack53.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_53 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_53 -- @@ -85,9 +90,10 @@ package body System.Pack_53 is N : Natural; Rev_SSO : Boolean) return Bits_53 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_53 is E : Bits_53; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack54.adb b/gcc/ada/libgnat/s-pack54.adb index 23ec58e..2cc4e9c 100644 --- a/gcc/ada/libgnat/s-pack54.adb +++ b/gcc/ada/libgnat/s-pack54.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_54 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); -- The following declarations are for the case where the address -- passed to GetU_54 or SetU_54 is not guaranteed to be aligned. @@ -84,12 +89,13 @@ package body System.Pack_54 is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); ------------ -- Get_54 -- @@ -100,9 +106,10 @@ package body System.Pack_54 is N : Natural; Rev_SSO : Boolean) return Bits_54 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -138,9 +145,10 @@ package body System.Pack_54 is N : Natural; Rev_SSO : Boolean) return Bits_54 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -177,9 +185,10 @@ package body System.Pack_54 is E : Bits_54; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -216,9 +225,10 @@ package body System.Pack_54 is E : Bits_54; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack55.adb b/gcc/ada/libgnat/s-pack55.adb index 3734f1a..b1264c7 100644 --- a/gcc/ada/libgnat/s-pack55.adb +++ b/gcc/ada/libgnat/s-pack55.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_55 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_55 -- @@ -85,9 +90,10 @@ package body System.Pack_55 is N : Natural; Rev_SSO : Boolean) return Bits_55 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_55 is E : Bits_55; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack56.adb b/gcc/ada/libgnat/s-pack56.adb index 821f206..100b348 100644 --- a/gcc/ada/libgnat/s-pack56.adb +++ b/gcc/ada/libgnat/s-pack56.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_56 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); -- The following declarations are for the case where the address -- passed to GetU_56 or SetU_56 is not guaranteed to be aligned. @@ -84,12 +89,13 @@ package body System.Pack_56 is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); ------------ -- Get_56 -- @@ -100,9 +106,10 @@ package body System.Pack_56 is N : Natural; Rev_SSO : Boolean) return Bits_56 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -138,9 +145,10 @@ package body System.Pack_56 is N : Natural; Rev_SSO : Boolean) return Bits_56 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -177,9 +185,10 @@ package body System.Pack_56 is E : Bits_56; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -216,9 +225,10 @@ package body System.Pack_56 is E : Bits_56; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack57.adb b/gcc/ada/libgnat/s-pack57.adb index e490b4d..1056212 100644 --- a/gcc/ada/libgnat/s-pack57.adb +++ b/gcc/ada/libgnat/s-pack57.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_57 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_57 -- @@ -85,9 +90,10 @@ package body System.Pack_57 is N : Natural; Rev_SSO : Boolean) return Bits_57 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_57 is E : Bits_57; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack58.adb b/gcc/ada/libgnat/s-pack58.adb index 383a278..c429d38 100644 --- a/gcc/ada/libgnat/s-pack58.adb +++ b/gcc/ada/libgnat/s-pack58.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_58 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); -- The following declarations are for the case where the address -- passed to GetU_58 or SetU_58 is not guaranteed to be aligned. @@ -84,12 +89,13 @@ package body System.Pack_58 is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); ------------ -- Get_58 -- @@ -100,9 +106,10 @@ package body System.Pack_58 is N : Natural; Rev_SSO : Boolean) return Bits_58 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -138,9 +145,10 @@ package body System.Pack_58 is N : Natural; Rev_SSO : Boolean) return Bits_58 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -177,9 +185,10 @@ package body System.Pack_58 is E : Bits_58; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -216,9 +225,10 @@ package body System.Pack_58 is E : Bits_58; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack59.adb b/gcc/ada/libgnat/s-pack59.adb index 56fb681..fe304b9 100644 --- a/gcc/ada/libgnat/s-pack59.adb +++ b/gcc/ada/libgnat/s-pack59.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_59 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_59 -- @@ -85,9 +90,10 @@ package body System.Pack_59 is N : Natural; Rev_SSO : Boolean) return Bits_59 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_59 is E : Bits_59; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack60.adb b/gcc/ada/libgnat/s-pack60.adb index d7c0bbf..1d1422b 100644 --- a/gcc/ada/libgnat/s-pack60.adb +++ b/gcc/ada/libgnat/s-pack60.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_60 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); -- The following declarations are for the case where the address -- passed to GetU_60 or SetU_60 is not guaranteed to be aligned. @@ -84,12 +89,13 @@ package body System.Pack_60 is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); ------------ -- Get_60 -- @@ -100,9 +106,10 @@ package body System.Pack_60 is N : Natural; Rev_SSO : Boolean) return Bits_60 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -138,9 +145,10 @@ package body System.Pack_60 is N : Natural; Rev_SSO : Boolean) return Bits_60 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -177,9 +185,10 @@ package body System.Pack_60 is E : Bits_60; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -216,9 +225,10 @@ package body System.Pack_60 is E : Bits_60; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack61.adb b/gcc/ada/libgnat/s-pack61.adb index ad15710..d744ff3 100644 --- a/gcc/ada/libgnat/s-pack61.adb +++ b/gcc/ada/libgnat/s-pack61.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_61 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_61 -- @@ -85,9 +90,10 @@ package body System.Pack_61 is N : Natural; Rev_SSO : Boolean) return Bits_61 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_61 is E : Bits_61; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack62.adb b/gcc/ada/libgnat/s-pack62.adb index 51064af..d4745cf 100644 --- a/gcc/ada/libgnat/s-pack62.adb +++ b/gcc/ada/libgnat/s-pack62.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_62 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); -- The following declarations are for the case where the address -- passed to GetU_62 or SetU_62 is not guaranteed to be aligned. @@ -84,12 +89,13 @@ package body System.Pack_62 is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); ------------ -- Get_62 -- @@ -100,9 +106,10 @@ package body System.Pack_62 is N : Natural; Rev_SSO : Boolean) return Bits_62 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -138,9 +145,10 @@ package body System.Pack_62 is N : Natural; Rev_SSO : Boolean) return Bits_62 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -177,9 +185,10 @@ package body System.Pack_62 is E : Bits_62; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -216,9 +225,10 @@ package body System.Pack_62 is E : Bits_62; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack63.adb b/gcc/ada/libgnat/s-pack63.adb index 27f2332..257fbab 100644 --- a/gcc/ada/libgnat/s-pack63.adb +++ b/gcc/ada/libgnat/s-pack63.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_63 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_63 -- @@ -85,9 +90,10 @@ package body System.Pack_63 is N : Natural; Rev_SSO : Boolean) return Bits_63 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_63 is E : Bits_63; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack65.adb b/gcc/ada/libgnat/s-pack65.adb index 00e7021..205b911 100644 --- a/gcc/ada/libgnat/s-pack65.adb +++ b/gcc/ada/libgnat/s-pack65.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_65 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_65 -- @@ -85,9 +90,10 @@ package body System.Pack_65 is N : Natural; Rev_SSO : Boolean) return Bits_65 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_65 is E : Bits_65; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack66.adb b/gcc/ada/libgnat/s-pack66.adb index 20cebc9..cb95338 100644 --- a/gcc/ada/libgnat/s-pack66.adb +++ b/gcc/ada/libgnat/s-pack66.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_66 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); -- The following declarations are for the case where the address -- passed to GetU_66 or SetU_66 is not guaranteed to be aligned. @@ -84,12 +89,13 @@ package body System.Pack_66 is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); ------------ -- Get_66 -- @@ -100,9 +106,10 @@ package body System.Pack_66 is N : Natural; Rev_SSO : Boolean) return Bits_66 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -138,9 +145,10 @@ package body System.Pack_66 is N : Natural; Rev_SSO : Boolean) return Bits_66 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -177,9 +185,10 @@ package body System.Pack_66 is E : Bits_66; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -216,9 +225,10 @@ package body System.Pack_66 is E : Bits_66; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack67.adb b/gcc/ada/libgnat/s-pack67.adb index 9b5accf..194510a 100644 --- a/gcc/ada/libgnat/s-pack67.adb +++ b/gcc/ada/libgnat/s-pack67.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_67 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_67 -- @@ -85,9 +90,10 @@ package body System.Pack_67 is N : Natural; Rev_SSO : Boolean) return Bits_67 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_67 is E : Bits_67; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack68.adb b/gcc/ada/libgnat/s-pack68.adb index b23bf88..cf7043d 100644 --- a/gcc/ada/libgnat/s-pack68.adb +++ b/gcc/ada/libgnat/s-pack68.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_68 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); -- The following declarations are for the case where the address -- passed to GetU_68 or SetU_68 is not guaranteed to be aligned. @@ -84,12 +89,13 @@ package body System.Pack_68 is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); ------------ -- Get_68 -- @@ -100,9 +106,10 @@ package body System.Pack_68 is N : Natural; Rev_SSO : Boolean) return Bits_68 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -138,9 +145,10 @@ package body System.Pack_68 is N : Natural; Rev_SSO : Boolean) return Bits_68 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -177,9 +185,10 @@ package body System.Pack_68 is E : Bits_68; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -216,9 +225,10 @@ package body System.Pack_68 is E : Bits_68; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack69.adb b/gcc/ada/libgnat/s-pack69.adb index e4ab9e5..670e612 100644 --- a/gcc/ada/libgnat/s-pack69.adb +++ b/gcc/ada/libgnat/s-pack69.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_69 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_69 -- @@ -85,9 +90,10 @@ package body System.Pack_69 is N : Natural; Rev_SSO : Boolean) return Bits_69 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_69 is E : Bits_69; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack70.adb b/gcc/ada/libgnat/s-pack70.adb index 9432384..aa320f6 100644 --- a/gcc/ada/libgnat/s-pack70.adb +++ b/gcc/ada/libgnat/s-pack70.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_70 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); -- The following declarations are for the case where the address -- passed to GetU_70 or SetU_70 is not guaranteed to be aligned. @@ -84,12 +89,13 @@ package body System.Pack_70 is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); ------------ -- Get_70 -- @@ -100,9 +106,10 @@ package body System.Pack_70 is N : Natural; Rev_SSO : Boolean) return Bits_70 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -138,9 +145,10 @@ package body System.Pack_70 is N : Natural; Rev_SSO : Boolean) return Bits_70 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -177,9 +185,10 @@ package body System.Pack_70 is E : Bits_70; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -216,9 +225,10 @@ package body System.Pack_70 is E : Bits_70; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack71.adb b/gcc/ada/libgnat/s-pack71.adb index bfc75d2..748a1c6 100644 --- a/gcc/ada/libgnat/s-pack71.adb +++ b/gcc/ada/libgnat/s-pack71.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_71 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_71 -- @@ -85,9 +90,10 @@ package body System.Pack_71 is N : Natural; Rev_SSO : Boolean) return Bits_71 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_71 is E : Bits_71; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack72.adb b/gcc/ada/libgnat/s-pack72.adb index 1b22c6b..b2c463a 100644 --- a/gcc/ada/libgnat/s-pack72.adb +++ b/gcc/ada/libgnat/s-pack72.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_72 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); -- The following declarations are for the case where the address -- passed to GetU_72 or SetU_72 is not guaranteed to be aligned. @@ -84,12 +89,13 @@ package body System.Pack_72 is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); ------------ -- Get_72 -- @@ -100,9 +106,10 @@ package body System.Pack_72 is N : Natural; Rev_SSO : Boolean) return Bits_72 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -138,9 +145,10 @@ package body System.Pack_72 is N : Natural; Rev_SSO : Boolean) return Bits_72 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -177,9 +185,10 @@ package body System.Pack_72 is E : Bits_72; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -216,9 +225,10 @@ package body System.Pack_72 is E : Bits_72; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack73.adb b/gcc/ada/libgnat/s-pack73.adb index a2e7345..3abaebe 100644 --- a/gcc/ada/libgnat/s-pack73.adb +++ b/gcc/ada/libgnat/s-pack73.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_73 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_73 -- @@ -85,9 +90,10 @@ package body System.Pack_73 is N : Natural; Rev_SSO : Boolean) return Bits_73 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_73 is E : Bits_73; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack74.adb b/gcc/ada/libgnat/s-pack74.adb index d1f772f..2fe64bc 100644 --- a/gcc/ada/libgnat/s-pack74.adb +++ b/gcc/ada/libgnat/s-pack74.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_74 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); -- The following declarations are for the case where the address -- passed to GetU_74 or SetU_74 is not guaranteed to be aligned. @@ -84,12 +89,13 @@ package body System.Pack_74 is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); ------------ -- Get_74 -- @@ -100,9 +106,10 @@ package body System.Pack_74 is N : Natural; Rev_SSO : Boolean) return Bits_74 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -138,9 +145,10 @@ package body System.Pack_74 is N : Natural; Rev_SSO : Boolean) return Bits_74 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -177,9 +185,10 @@ package body System.Pack_74 is E : Bits_74; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -216,9 +225,10 @@ package body System.Pack_74 is E : Bits_74; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack75.adb b/gcc/ada/libgnat/s-pack75.adb index af38ad3..d62afc9 100644 --- a/gcc/ada/libgnat/s-pack75.adb +++ b/gcc/ada/libgnat/s-pack75.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_75 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_75 -- @@ -85,9 +90,10 @@ package body System.Pack_75 is N : Natural; Rev_SSO : Boolean) return Bits_75 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_75 is E : Bits_75; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack76.adb b/gcc/ada/libgnat/s-pack76.adb index d043013..30c1596 100644 --- a/gcc/ada/libgnat/s-pack76.adb +++ b/gcc/ada/libgnat/s-pack76.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_76 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); -- The following declarations are for the case where the address -- passed to GetU_76 or SetU_76 is not guaranteed to be aligned. @@ -84,12 +89,13 @@ package body System.Pack_76 is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); ------------ -- Get_76 -- @@ -100,9 +106,10 @@ package body System.Pack_76 is N : Natural; Rev_SSO : Boolean) return Bits_76 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -138,9 +145,10 @@ package body System.Pack_76 is N : Natural; Rev_SSO : Boolean) return Bits_76 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -177,9 +185,10 @@ package body System.Pack_76 is E : Bits_76; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -216,9 +225,10 @@ package body System.Pack_76 is E : Bits_76; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack77.adb b/gcc/ada/libgnat/s-pack77.adb index 28a971a..eadc779 100644 --- a/gcc/ada/libgnat/s-pack77.adb +++ b/gcc/ada/libgnat/s-pack77.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_77 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_77 -- @@ -85,9 +90,10 @@ package body System.Pack_77 is N : Natural; Rev_SSO : Boolean) return Bits_77 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_77 is E : Bits_77; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack78.adb b/gcc/ada/libgnat/s-pack78.adb index 6cbb11f..e5f1896 100644 --- a/gcc/ada/libgnat/s-pack78.adb +++ b/gcc/ada/libgnat/s-pack78.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_78 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); -- The following declarations are for the case where the address -- passed to GetU_78 or SetU_78 is not guaranteed to be aligned. @@ -84,12 +89,13 @@ package body System.Pack_78 is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); ------------ -- Get_78 -- @@ -100,9 +106,10 @@ package body System.Pack_78 is N : Natural; Rev_SSO : Boolean) return Bits_78 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -138,9 +145,10 @@ package body System.Pack_78 is N : Natural; Rev_SSO : Boolean) return Bits_78 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -177,9 +185,10 @@ package body System.Pack_78 is E : Bits_78; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -216,9 +225,10 @@ package body System.Pack_78 is E : Bits_78; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack79.adb b/gcc/ada/libgnat/s-pack79.adb index 0653f4a..f2e52af 100644 --- a/gcc/ada/libgnat/s-pack79.adb +++ b/gcc/ada/libgnat/s-pack79.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_79 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_79 -- @@ -85,9 +90,10 @@ package body System.Pack_79 is N : Natural; Rev_SSO : Boolean) return Bits_79 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_79 is E : Bits_79; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack80.adb b/gcc/ada/libgnat/s-pack80.adb index 8df62be..8668ad0 100644 --- a/gcc/ada/libgnat/s-pack80.adb +++ b/gcc/ada/libgnat/s-pack80.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_80 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); -- The following declarations are for the case where the address -- passed to GetU_80 or SetU_80 is not guaranteed to be aligned. @@ -84,12 +89,13 @@ package body System.Pack_80 is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); ------------ -- Get_80 -- @@ -100,9 +106,10 @@ package body System.Pack_80 is N : Natural; Rev_SSO : Boolean) return Bits_80 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -138,9 +145,10 @@ package body System.Pack_80 is N : Natural; Rev_SSO : Boolean) return Bits_80 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -177,9 +185,10 @@ package body System.Pack_80 is E : Bits_80; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -216,9 +225,10 @@ package body System.Pack_80 is E : Bits_80; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack81.adb b/gcc/ada/libgnat/s-pack81.adb index e1c308d..2100734 100644 --- a/gcc/ada/libgnat/s-pack81.adb +++ b/gcc/ada/libgnat/s-pack81.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_81 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_81 -- @@ -85,9 +90,10 @@ package body System.Pack_81 is N : Natural; Rev_SSO : Boolean) return Bits_81 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_81 is E : Bits_81; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack82.adb b/gcc/ada/libgnat/s-pack82.adb index c87a867..9e405a0 100644 --- a/gcc/ada/libgnat/s-pack82.adb +++ b/gcc/ada/libgnat/s-pack82.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_82 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); -- The following declarations are for the case where the address -- passed to GetU_82 or SetU_82 is not guaranteed to be aligned. @@ -84,12 +89,13 @@ package body System.Pack_82 is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); ------------ -- Get_82 -- @@ -100,9 +106,10 @@ package body System.Pack_82 is N : Natural; Rev_SSO : Boolean) return Bits_82 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -138,9 +145,10 @@ package body System.Pack_82 is N : Natural; Rev_SSO : Boolean) return Bits_82 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -177,9 +185,10 @@ package body System.Pack_82 is E : Bits_82; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -216,9 +225,10 @@ package body System.Pack_82 is E : Bits_82; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack83.adb b/gcc/ada/libgnat/s-pack83.adb index 12e67be..49420e6 100644 --- a/gcc/ada/libgnat/s-pack83.adb +++ b/gcc/ada/libgnat/s-pack83.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_83 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_83 -- @@ -85,9 +90,10 @@ package body System.Pack_83 is N : Natural; Rev_SSO : Boolean) return Bits_83 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_83 is E : Bits_83; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack84.adb b/gcc/ada/libgnat/s-pack84.adb index 996ab78..a351194 100644 --- a/gcc/ada/libgnat/s-pack84.adb +++ b/gcc/ada/libgnat/s-pack84.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_84 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); -- The following declarations are for the case where the address -- passed to GetU_84 or SetU_84 is not guaranteed to be aligned. @@ -84,12 +89,13 @@ package body System.Pack_84 is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); ------------ -- Get_84 -- @@ -100,9 +106,10 @@ package body System.Pack_84 is N : Natural; Rev_SSO : Boolean) return Bits_84 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -138,9 +145,10 @@ package body System.Pack_84 is N : Natural; Rev_SSO : Boolean) return Bits_84 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -177,9 +185,10 @@ package body System.Pack_84 is E : Bits_84; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -216,9 +225,10 @@ package body System.Pack_84 is E : Bits_84; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack85.adb b/gcc/ada/libgnat/s-pack85.adb index 9d62d1c..b700e2e 100644 --- a/gcc/ada/libgnat/s-pack85.adb +++ b/gcc/ada/libgnat/s-pack85.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_85 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_85 -- @@ -85,9 +90,10 @@ package body System.Pack_85 is N : Natural; Rev_SSO : Boolean) return Bits_85 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_85 is E : Bits_85; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack86.adb b/gcc/ada/libgnat/s-pack86.adb index b34b58b..3bf32d4 100644 --- a/gcc/ada/libgnat/s-pack86.adb +++ b/gcc/ada/libgnat/s-pack86.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_86 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); -- The following declarations are for the case where the address -- passed to GetU_86 or SetU_86 is not guaranteed to be aligned. @@ -84,12 +89,13 @@ package body System.Pack_86 is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); ------------ -- Get_86 -- @@ -100,9 +106,10 @@ package body System.Pack_86 is N : Natural; Rev_SSO : Boolean) return Bits_86 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -138,9 +145,10 @@ package body System.Pack_86 is N : Natural; Rev_SSO : Boolean) return Bits_86 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -177,9 +185,10 @@ package body System.Pack_86 is E : Bits_86; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -216,9 +225,10 @@ package body System.Pack_86 is E : Bits_86; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack87.adb b/gcc/ada/libgnat/s-pack87.adb index 37b0e34..23e460b 100644 --- a/gcc/ada/libgnat/s-pack87.adb +++ b/gcc/ada/libgnat/s-pack87.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_87 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_87 -- @@ -85,9 +90,10 @@ package body System.Pack_87 is N : Natural; Rev_SSO : Boolean) return Bits_87 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_87 is E : Bits_87; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack88.adb b/gcc/ada/libgnat/s-pack88.adb index 0bda159..a17f248 100644 --- a/gcc/ada/libgnat/s-pack88.adb +++ b/gcc/ada/libgnat/s-pack88.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_88 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); -- The following declarations are for the case where the address -- passed to GetU_88 or SetU_88 is not guaranteed to be aligned. @@ -84,12 +89,13 @@ package body System.Pack_88 is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); ------------ -- Get_88 -- @@ -100,9 +106,10 @@ package body System.Pack_88 is N : Natural; Rev_SSO : Boolean) return Bits_88 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -138,9 +145,10 @@ package body System.Pack_88 is N : Natural; Rev_SSO : Boolean) return Bits_88 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -177,9 +185,10 @@ package body System.Pack_88 is E : Bits_88; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -216,9 +225,10 @@ package body System.Pack_88 is E : Bits_88; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack89.adb b/gcc/ada/libgnat/s-pack89.adb index 7d5a924..323005c 100644 --- a/gcc/ada/libgnat/s-pack89.adb +++ b/gcc/ada/libgnat/s-pack89.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_89 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_89 -- @@ -85,9 +90,10 @@ package body System.Pack_89 is N : Natural; Rev_SSO : Boolean) return Bits_89 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_89 is E : Bits_89; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack90.adb b/gcc/ada/libgnat/s-pack90.adb index 03a4022..badcd3f 100644 --- a/gcc/ada/libgnat/s-pack90.adb +++ b/gcc/ada/libgnat/s-pack90.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_90 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); -- The following declarations are for the case where the address -- passed to GetU_90 or SetU_90 is not guaranteed to be aligned. @@ -84,12 +89,13 @@ package body System.Pack_90 is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); ------------ -- Get_90 -- @@ -100,9 +106,10 @@ package body System.Pack_90 is N : Natural; Rev_SSO : Boolean) return Bits_90 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -138,9 +145,10 @@ package body System.Pack_90 is N : Natural; Rev_SSO : Boolean) return Bits_90 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -177,9 +185,10 @@ package body System.Pack_90 is E : Bits_90; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -216,9 +225,10 @@ package body System.Pack_90 is E : Bits_90; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack91.adb b/gcc/ada/libgnat/s-pack91.adb index b6ccbbf..5233fda 100644 --- a/gcc/ada/libgnat/s-pack91.adb +++ b/gcc/ada/libgnat/s-pack91.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_91 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_91 -- @@ -85,9 +90,10 @@ package body System.Pack_91 is N : Natural; Rev_SSO : Boolean) return Bits_91 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_91 is E : Bits_91; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack92.adb b/gcc/ada/libgnat/s-pack92.adb index e783869..32f7aef 100644 --- a/gcc/ada/libgnat/s-pack92.adb +++ b/gcc/ada/libgnat/s-pack92.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_92 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); -- The following declarations are for the case where the address -- passed to GetU_92 or SetU_92 is not guaranteed to be aligned. @@ -84,12 +89,13 @@ package body System.Pack_92 is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); ------------ -- Get_92 -- @@ -100,9 +106,10 @@ package body System.Pack_92 is N : Natural; Rev_SSO : Boolean) return Bits_92 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -138,9 +145,10 @@ package body System.Pack_92 is N : Natural; Rev_SSO : Boolean) return Bits_92 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -177,9 +185,10 @@ package body System.Pack_92 is E : Bits_92; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -216,9 +225,10 @@ package body System.Pack_92 is E : Bits_92; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack93.adb b/gcc/ada/libgnat/s-pack93.adb index 83be850..079b1be 100644 --- a/gcc/ada/libgnat/s-pack93.adb +++ b/gcc/ada/libgnat/s-pack93.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_93 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_93 -- @@ -85,9 +90,10 @@ package body System.Pack_93 is N : Natural; Rev_SSO : Boolean) return Bits_93 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_93 is E : Bits_93; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack94.adb b/gcc/ada/libgnat/s-pack94.adb index 1ad7e54..0964b37 100644 --- a/gcc/ada/libgnat/s-pack94.adb +++ b/gcc/ada/libgnat/s-pack94.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_94 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); -- The following declarations are for the case where the address -- passed to GetU_94 or SetU_94 is not guaranteed to be aligned. @@ -84,12 +89,13 @@ package body System.Pack_94 is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); ------------ -- Get_94 -- @@ -100,9 +106,10 @@ package body System.Pack_94 is N : Natural; Rev_SSO : Boolean) return Bits_94 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -138,9 +145,10 @@ package body System.Pack_94 is N : Natural; Rev_SSO : Boolean) return Bits_94 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -177,9 +185,10 @@ package body System.Pack_94 is E : Bits_94; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -216,9 +225,10 @@ package body System.Pack_94 is E : Bits_94; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack95.adb b/gcc/ada/libgnat/s-pack95.adb index aeca0c6..c81c259 100644 --- a/gcc/ada/libgnat/s-pack95.adb +++ b/gcc/ada/libgnat/s-pack95.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_95 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_95 -- @@ -85,9 +90,10 @@ package body System.Pack_95 is N : Natural; Rev_SSO : Boolean) return Bits_95 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_95 is E : Bits_95; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack96.adb b/gcc/ada/libgnat/s-pack96.adb index 4ed75c7..47bc025d 100644 --- a/gcc/ada/libgnat/s-pack96.adb +++ b/gcc/ada/libgnat/s-pack96.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_96 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); -- The following declarations are for the case where the address -- passed to GetU_96 or SetU_96 is not guaranteed to be aligned. @@ -84,12 +89,13 @@ package body System.Pack_96 is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); ------------ -- Get_96 -- @@ -100,9 +106,10 @@ package body System.Pack_96 is N : Natural; Rev_SSO : Boolean) return Bits_96 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -138,9 +145,10 @@ package body System.Pack_96 is N : Natural; Rev_SSO : Boolean) return Bits_96 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -177,9 +185,10 @@ package body System.Pack_96 is E : Bits_96; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -216,9 +225,10 @@ package body System.Pack_96 is E : Bits_96; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack97.adb b/gcc/ada/libgnat/s-pack97.adb index 316780e..737fc0f 100644 --- a/gcc/ada/libgnat/s-pack97.adb +++ b/gcc/ada/libgnat/s-pack97.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_97 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_97 -- @@ -85,9 +90,10 @@ package body System.Pack_97 is N : Natural; Rev_SSO : Boolean) return Bits_97 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_97 is E : Bits_97; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack98.adb b/gcc/ada/libgnat/s-pack98.adb index b1c9074..f6d3264 100644 --- a/gcc/ada/libgnat/s-pack98.adb +++ b/gcc/ada/libgnat/s-pack98.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_98 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); -- The following declarations are for the case where the address -- passed to GetU_98 or SetU_98 is not guaranteed to be aligned. @@ -84,12 +89,13 @@ package body System.Pack_98 is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); ------------ -- Get_98 -- @@ -100,9 +106,10 @@ package body System.Pack_98 is N : Natural; Rev_SSO : Boolean) return Bits_98 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -138,9 +145,10 @@ package body System.Pack_98 is N : Natural; Rev_SSO : Boolean) return Bits_98 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -177,9 +185,10 @@ package body System.Pack_98 is E : Bits_98; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -216,9 +225,10 @@ package body System.Pack_98 is E : Bits_98; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/libgnat/s-pack99.adb b/gcc/ada/libgnat/s-pack99.adb index 08e0726..9cc57f1 100644 --- a/gcc/ada/libgnat/s-pack99.adb +++ b/gcc/ada/libgnat/s-pack99.adb @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_99 is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); ------------ -- Get_99 -- @@ -85,9 +90,10 @@ package body System.Pack_99 is N : Natural; Rev_SSO : Boolean) return Bits_99 is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -124,9 +130,10 @@ package body System.Pack_99 is E : Bits_99; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is diff --git a/gcc/ada/s-pack.adb.tmpl b/gcc/ada/s-pack.adb.tmpl index 69da423..540c519 100644 --- a/gcc/ada/s-pack.adb.tmpl +++ b/gcc/ada/s-pack.adb.tmpl @@ -29,6 +29,7 @@ -- -- ------------------------------------------------------------------------------ +with System.Address_To_Access_Conversions; with System.Storage_Elements; with System.Unsigned_Types; @@ -69,12 +70,16 @@ package body System.Pack_@@ is -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. - type Cluster_Ref is access Cluster; + package AAC is new Address_To_Access_Conversions (Cluster); + -- We convert addresses to access values and dereference them instead of + -- directly using overlays in order to work around the implementation of + -- the RM 13.3(19) clause, which would pessimize the generated code. type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_Cluster_Ref is access Rev_Cluster; + + package Rev_AAC is new Address_To_Access_Conversions (Rev_Cluster); @even -- The following declarations are for the case where the address @@ -85,12 +90,13 @@ package body System.Pack_@@ is type ClusterU is new Cluster; for ClusterU'Alignment use 1; - type ClusterU_Ref is access ClusterU; + package AACU is new Address_To_Access_Conversions (ClusterU); type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; - type Rev_ClusterU_Ref is access Rev_ClusterU; + + package Rev_AACU is new Address_To_Access_Conversions (Rev_ClusterU); @/even ------------ @@ -102,9 +108,10 @@ package body System.Pack_@@ is N : Natural; Rev_SSO : Boolean) return Bits_@@ is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin return (if Rev_SSO then @@ -141,9 +148,10 @@ package body System.Pack_@@ is N : Natural; Rev_SSO : Boolean) return Bits_@@ is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin return (if Rev_SSO then @@ -181,9 +189,10 @@ package body System.Pack_@@ is E : Bits_@@; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : Cluster_Ref with Address => A'Address, Import; - RC : Rev_Cluster_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AAC.Object_Pointer := AAC.To_Pointer (A); + RC : constant Rev_AAC.Object_Pointer := Rev_AAC.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is @@ -221,9 +230,10 @@ package body System.Pack_@@ is E : Bits_@@; Rev_SSO : Boolean) is - A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); - C : ClusterU_Ref with Address => A'Address, Import; - RC : Rev_ClusterU_Ref with Address => A'Address, Import; + A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); + C : constant AACU.Object_Pointer := AACU.To_Pointer (A); + RC : constant Rev_AACU.Object_Pointer := Rev_AACU.To_Pointer (A); + begin if Rev_SSO then case N07 (Uns (N) mod 8) is |