]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Remove use of overlays in implementation of System.Pack_N units
authorEric Botcazou <ebotcazou@adacore.com>
Fri, 20 Sep 2024 18:24:55 +0000 (20:24 +0200)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Tue, 12 Nov 2024 13:00:51 +0000 (14:00 +0100)
The implementation uses an overlay between an address and an access value,
which is convoluted. This changes it to use a direct conversion instead.

No functional changes (and no changes to generated code at -O2).

gcc/ada/ChangeLog:

* s-pack.adb.tmpl: Add "with System.Address_To_Access_Conversions".
(Cluster_Ref): Delete.
(AAC): New instance of System.Address_To_Access_Conversions.
(Rev_Cluster_Ref): Delete.
(Rev_ACC): New instance of System.Address_To_Access_Conversions.
(ClusterU_Ref): Delete.
(AACU): New instance of System.Address_To_Access_Conversions.
(Rev_ClusterU_Ref): Delete.
(Rev_ACCU): New instance of System.Address_To_Access_Conversions.
(Get_@@): Use a direct address-to-access conversion.
(GetU_@@): Likewise.
(Set_@@): Likewise.
(SetU_@@): Likewise.
* libgnat/s-pack03.adb: Regenerate.
* libgnat/s-pack05.adb: Likewise.
* libgnat/s-pack06.adb: Likewise.
* libgnat/s-pack07.adb: Likewise.
* libgnat/s-pack09.adb: Likewise.
* libgnat/s-pack10.adb: Likewise.
* libgnat/s-pack100.adb: Likewise.
* libgnat/s-pack101.adb: Likewise.
* libgnat/s-pack102.adb: Likewise.
* libgnat/s-pack103.adb: Likewise.
* libgnat/s-pack104.adb: Likewise.
* libgnat/s-pack105.adb: Likewise.
* libgnat/s-pack106.adb: Likewise.
* libgnat/s-pack107.adb: Likewise.
* libgnat/s-pack108.adb: Likewise.
* libgnat/s-pack109.adb: Likewise.
* libgnat/s-pack11.adb: Likewise.
* libgnat/s-pack110.adb: Likewise.
* libgnat/s-pack111.adb: Likewise.
* libgnat/s-pack112.adb: Likewise.
* libgnat/s-pack113.adb: Likewise.
* libgnat/s-pack114.adb: Likewise.
* libgnat/s-pack115.adb: Likewise.
* libgnat/s-pack116.adb: Likewise.
* libgnat/s-pack117.adb: Likewise.
* libgnat/s-pack118.adb: Likewise.
* libgnat/s-pack119.adb: Likewise.
* libgnat/s-pack12.adb: Likewise.
* libgnat/s-pack120.adb: Likewise.
* libgnat/s-pack121.adb: Likewise.
* libgnat/s-pack122.adb: Likewise.
* libgnat/s-pack123.adb: Likewise.
* libgnat/s-pack124.adb: Likewise.
* libgnat/s-pack125.adb: Likewise.
* libgnat/s-pack126.adb: Likewise.
* libgnat/s-pack127.adb: Likewise.
* libgnat/s-pack13.adb: Likewise.
* libgnat/s-pack14.adb: Likewise.
* libgnat/s-pack15.adb: Likewise.
* libgnat/s-pack17.adb: Likewise.
* libgnat/s-pack18.adb: Likewise.
* libgnat/s-pack19.adb: Likewise.
* libgnat/s-pack20.adb: Likewise.
* libgnat/s-pack21.adb: Likewise.
* libgnat/s-pack22.adb: Likewise.
* libgnat/s-pack23.adb: Likewise.
* libgnat/s-pack24.adb: Likewise.
* libgnat/s-pack25.adb: Likewise.
* libgnat/s-pack26.adb: Likewise.
* libgnat/s-pack27.adb: Likewise.
* libgnat/s-pack28.adb: Likewise.
* libgnat/s-pack29.adb: Likewise.
* libgnat/s-pack30.adb: Likewise.
* libgnat/s-pack31.adb: Likewise.
* libgnat/s-pack33.adb: Likewise.
* libgnat/s-pack34.adb: Likewise.
* libgnat/s-pack35.adb: Likewise.
* libgnat/s-pack36.adb: Likewise.
* libgnat/s-pack37.adb: Likewise.
* libgnat/s-pack38.adb: Likewise.
* libgnat/s-pack39.adb: Likewise.
* libgnat/s-pack40.adb: Likewise.
* libgnat/s-pack41.adb: Likewise.
* libgnat/s-pack42.adb: Likewise.
* libgnat/s-pack43.adb: Likewise.
* libgnat/s-pack44.adb: Likewise.
* libgnat/s-pack45.adb: Likewise.
* libgnat/s-pack46.adb: Likewise.
* libgnat/s-pack47.adb: Likewise.
* libgnat/s-pack48.adb: Likewise.
* libgnat/s-pack49.adb: Likewise.
* libgnat/s-pack50.adb: Likewise.
* libgnat/s-pack51.adb: Likewise.
* libgnat/s-pack52.adb: Likewise.
* libgnat/s-pack53.adb: Likewise.
* libgnat/s-pack54.adb: Likewise.
* libgnat/s-pack55.adb: Likewise.
* libgnat/s-pack56.adb: Likewise.
* libgnat/s-pack57.adb: Likewise.
* libgnat/s-pack58.adb: Likewise.
* libgnat/s-pack59.adb: Likewise.
* libgnat/s-pack60.adb: Likewise.
* libgnat/s-pack61.adb: Likewise.
* libgnat/s-pack62.adb: Likewise.
* libgnat/s-pack63.adb: Likewise.
* libgnat/s-pack65.adb: Likewise.
* libgnat/s-pack66.adb: Likewise.
* libgnat/s-pack67.adb: Likewise.
* libgnat/s-pack68.adb: Likewise.
* libgnat/s-pack69.adb: Likewise.
* libgnat/s-pack70.adb: Likewise.
* libgnat/s-pack71.adb: Likewise.
* libgnat/s-pack72.adb: Likewise.
* libgnat/s-pack73.adb: Likewise.
* libgnat/s-pack74.adb: Likewise.
* libgnat/s-pack75.adb: Likewise.
* libgnat/s-pack76.adb: Likewise.
* libgnat/s-pack77.adb: Likewise.
* libgnat/s-pack78.adb: Likewise.
* libgnat/s-pack79.adb: Likewise.
* libgnat/s-pack80.adb: Likewise.
* libgnat/s-pack81.adb: Likewise.
* libgnat/s-pack82.adb: Likewise.
* libgnat/s-pack83.adb: Likewise.
* libgnat/s-pack84.adb: Likewise.
* libgnat/s-pack85.adb: Likewise.
* libgnat/s-pack86.adb: Likewise.
* libgnat/s-pack87.adb: Likewise.
* libgnat/s-pack88.adb: Likewise.
* libgnat/s-pack89.adb: Likewise.
* libgnat/s-pack90.adb: Likewise.
* libgnat/s-pack91.adb: Likewise.
* libgnat/s-pack92.adb: Likewise.
* libgnat/s-pack93.adb: Likewise.
* libgnat/s-pack94.adb: Likewise.
* libgnat/s-pack95.adb: Likewise.
* libgnat/s-pack96.adb: Likewise.
* libgnat/s-pack97.adb: Likewise.
* libgnat/s-pack98.adb: Likewise.
* libgnat/s-pack99.adb: Likewise.

121 files changed:
gcc/ada/libgnat/s-pack03.adb
gcc/ada/libgnat/s-pack05.adb
gcc/ada/libgnat/s-pack06.adb
gcc/ada/libgnat/s-pack07.adb
gcc/ada/libgnat/s-pack09.adb
gcc/ada/libgnat/s-pack10.adb
gcc/ada/libgnat/s-pack100.adb
gcc/ada/libgnat/s-pack101.adb
gcc/ada/libgnat/s-pack102.adb
gcc/ada/libgnat/s-pack103.adb
gcc/ada/libgnat/s-pack104.adb
gcc/ada/libgnat/s-pack105.adb
gcc/ada/libgnat/s-pack106.adb
gcc/ada/libgnat/s-pack107.adb
gcc/ada/libgnat/s-pack108.adb
gcc/ada/libgnat/s-pack109.adb
gcc/ada/libgnat/s-pack11.adb
gcc/ada/libgnat/s-pack110.adb
gcc/ada/libgnat/s-pack111.adb
gcc/ada/libgnat/s-pack112.adb
gcc/ada/libgnat/s-pack113.adb
gcc/ada/libgnat/s-pack114.adb
gcc/ada/libgnat/s-pack115.adb
gcc/ada/libgnat/s-pack116.adb
gcc/ada/libgnat/s-pack117.adb
gcc/ada/libgnat/s-pack118.adb
gcc/ada/libgnat/s-pack119.adb
gcc/ada/libgnat/s-pack12.adb
gcc/ada/libgnat/s-pack120.adb
gcc/ada/libgnat/s-pack121.adb
gcc/ada/libgnat/s-pack122.adb
gcc/ada/libgnat/s-pack123.adb
gcc/ada/libgnat/s-pack124.adb
gcc/ada/libgnat/s-pack125.adb
gcc/ada/libgnat/s-pack126.adb
gcc/ada/libgnat/s-pack127.adb
gcc/ada/libgnat/s-pack13.adb
gcc/ada/libgnat/s-pack14.adb
gcc/ada/libgnat/s-pack15.adb
gcc/ada/libgnat/s-pack17.adb
gcc/ada/libgnat/s-pack18.adb
gcc/ada/libgnat/s-pack19.adb
gcc/ada/libgnat/s-pack20.adb
gcc/ada/libgnat/s-pack21.adb
gcc/ada/libgnat/s-pack22.adb
gcc/ada/libgnat/s-pack23.adb
gcc/ada/libgnat/s-pack24.adb
gcc/ada/libgnat/s-pack25.adb
gcc/ada/libgnat/s-pack26.adb
gcc/ada/libgnat/s-pack27.adb
gcc/ada/libgnat/s-pack28.adb
gcc/ada/libgnat/s-pack29.adb
gcc/ada/libgnat/s-pack30.adb
gcc/ada/libgnat/s-pack31.adb
gcc/ada/libgnat/s-pack33.adb
gcc/ada/libgnat/s-pack34.adb
gcc/ada/libgnat/s-pack35.adb
gcc/ada/libgnat/s-pack36.adb
gcc/ada/libgnat/s-pack37.adb
gcc/ada/libgnat/s-pack38.adb
gcc/ada/libgnat/s-pack39.adb
gcc/ada/libgnat/s-pack40.adb
gcc/ada/libgnat/s-pack41.adb
gcc/ada/libgnat/s-pack42.adb
gcc/ada/libgnat/s-pack43.adb
gcc/ada/libgnat/s-pack44.adb
gcc/ada/libgnat/s-pack45.adb
gcc/ada/libgnat/s-pack46.adb
gcc/ada/libgnat/s-pack47.adb
gcc/ada/libgnat/s-pack48.adb
gcc/ada/libgnat/s-pack49.adb
gcc/ada/libgnat/s-pack50.adb
gcc/ada/libgnat/s-pack51.adb
gcc/ada/libgnat/s-pack52.adb
gcc/ada/libgnat/s-pack53.adb
gcc/ada/libgnat/s-pack54.adb
gcc/ada/libgnat/s-pack55.adb
gcc/ada/libgnat/s-pack56.adb
gcc/ada/libgnat/s-pack57.adb
gcc/ada/libgnat/s-pack58.adb
gcc/ada/libgnat/s-pack59.adb
gcc/ada/libgnat/s-pack60.adb
gcc/ada/libgnat/s-pack61.adb
gcc/ada/libgnat/s-pack62.adb
gcc/ada/libgnat/s-pack63.adb
gcc/ada/libgnat/s-pack65.adb
gcc/ada/libgnat/s-pack66.adb
gcc/ada/libgnat/s-pack67.adb
gcc/ada/libgnat/s-pack68.adb
gcc/ada/libgnat/s-pack69.adb
gcc/ada/libgnat/s-pack70.adb
gcc/ada/libgnat/s-pack71.adb
gcc/ada/libgnat/s-pack72.adb
gcc/ada/libgnat/s-pack73.adb
gcc/ada/libgnat/s-pack74.adb
gcc/ada/libgnat/s-pack75.adb
gcc/ada/libgnat/s-pack76.adb
gcc/ada/libgnat/s-pack77.adb
gcc/ada/libgnat/s-pack78.adb
gcc/ada/libgnat/s-pack79.adb
gcc/ada/libgnat/s-pack80.adb
gcc/ada/libgnat/s-pack81.adb
gcc/ada/libgnat/s-pack82.adb
gcc/ada/libgnat/s-pack83.adb
gcc/ada/libgnat/s-pack84.adb
gcc/ada/libgnat/s-pack85.adb
gcc/ada/libgnat/s-pack86.adb
gcc/ada/libgnat/s-pack87.adb
gcc/ada/libgnat/s-pack88.adb
gcc/ada/libgnat/s-pack89.adb
gcc/ada/libgnat/s-pack90.adb
gcc/ada/libgnat/s-pack91.adb
gcc/ada/libgnat/s-pack92.adb
gcc/ada/libgnat/s-pack93.adb
gcc/ada/libgnat/s-pack94.adb
gcc/ada/libgnat/s-pack95.adb
gcc/ada/libgnat/s-pack96.adb
gcc/ada/libgnat/s-pack97.adb
gcc/ada/libgnat/s-pack98.adb
gcc/ada/libgnat/s-pack99.adb
gcc/ada/s-pack.adb.tmpl

index 73f54db0f12b3e49b6ef1fb8e37afcc3c7745913..56b036e91cba170cbb770f9c5c1e68262f3871c8 100644 (file)
@@ -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
index 48db6692236b67672c0cc13ba938d810e5a4e8bc..0abccaf9c907856d6e8197b40a86061ee8a13d72 100644 (file)
@@ -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
index c27412c87bef5f7b4224a5aea8ac59777524b9d6..3b85634190ff193789d2191721ad6adaf55c4607 100644 (file)
@@ -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
index 159fb21e9efb7759bce16e876f7fe17b601924d3..e93aca55d921eb480ef0ce4eeb34df779d97e118 100644 (file)
@@ -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
index a1fb415547ab137630d0999adc4ea02775ce3fcf..85bc49acb21e268d99c8a4a4bd586d21a7d57f4a 100644 (file)
@@ -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
index 42e1c3a2a3a116391b19cb1bc5aa0ebf75585994..6bf3ab76cbb9ee9db5825da334db5f02b24ff85a 100644 (file)
@@ -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
index 8429dafc3b80aceefab71601d6d049093ae07418..b413f4589332f7989f287ca9c7313dd3ad0d89d2 100644 (file)
@@ -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
index eb22abd4810ad19be3aecfc6aa31df256814862e..5d5fdb3adee2535a837983088f4c3d99c3a731a1 100644 (file)
@@ -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
index 6ac093c8af64c417289e8592a1363078ddbd0ca9..b00f67bee2e83f7726686dc9c53ca4effbe9d07b 100644 (file)
@@ -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
index a51ba946630fca96caaa82fe99a9395b8429463d..0839c892d051a9b72cb9f10830bc7da526127d68 100644 (file)
@@ -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
index 24f5fb46f9c511657e0dafce16908bfd588168af..b3430e5d214ede8c2056a3c1e03b88d15e48e1a0 100644 (file)
@@ -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
index 53979475bde3291b2901aaac2c24cb5ae6948209..4355aca84fab8025bb1742f5b737ad494c90d4fc 100644 (file)
@@ -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
index bd1631ee2282bcc2bbfc3d56c939524bfb632fee..870ab724811b642d0fd6c43cf5d014a7337cf45a 100644 (file)
@@ -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
index b2e84acd22e46f9a1faeef21aa7f88bec2bf3da3..22667170b9014143692e3a1e16b531317f28807d 100644 (file)
@@ -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
index 2f37e0ce4cbeeced39589d395786199cf4c11296..87c8a3372622a579f10a845184a1d4bd878079b5 100644 (file)
@@ -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
index a227b27619e1d93aa482d301ef90f7694854916a..278d206df3b0f5be0a8627a52eec22d9f18c3ea6 100644 (file)
@@ -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
index 4b227e9ce27ecf202dc527e173f7c75b560cd774..61312ce41b4afaee7b6334121eef81608cf624c0 100644 (file)
@@ -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
index a6ae71bc5d84385d3a9b4f9aadcf346152c4879a..40c588461425c5f4717c10a0e2618115f7258203 100644 (file)
@@ -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
index d0068d26e168900752e2d8ba95e9650feb94eafb..4b4e5b40aa7cb6935a4ead2bc6ebbb2e74e6b7e3 100644 (file)
@@ -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
index fe3b608080dd42dcee68a5e099f4f012d64fb570..16dedbc833529e2a4baeff17c4af90c05cf932c7 100644 (file)
@@ -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
index 7430264b64d408a88f54897588fcacecfe1f579c..4376c2aac40220b0bb9f39720952411911797a98 100644 (file)
@@ -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
index f0bdba210063f38064eed9264d6600a68e99d6f1..7d0d4c6d628bd505c7404a34c393dab9b085f949 100644 (file)
@@ -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
index ba6448a52eaa1f30ff95d3f4964d9487e6dcd1b7..ccca0e730880ba45c6783ee94451901a1cc6cc77 100644 (file)
@@ -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
index 9fa7645e166c0c4477623cf112feceaaee525fef..4787e6a48b4c734c7ecfc929eb741f68bbfe11b0 100644 (file)
@@ -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
index e9be2444dfe0df305d837d5b7522cc31b8318b43..b6940d1fa702d55a657f486f0d62e3c3321d8824 100644 (file)
@@ -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
index 4290e0da192cd9ce5519e235fd9fa07a6d8b70f8..85aa2d5ec78b313adf637b07c94352a63ea4af3b 100644 (file)
@@ -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
index dd27b4cb1af39ee1633d87648094e8f5f84e8d43..5351727aab826c869b5f95ca7a62da0b8a9b484b 100644 (file)
@@ -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
index 8ae52d2f791e8f31ac0f0554e60bedd317322b2f..6ff08c2cf62405913d4555227e6e265e27ccec58 100644 (file)
@@ -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
index fdea3afdf2b65a73b381d94c743b3a7bc623ac4a..9ba90991874dff184822d70a086b30cbebb82484 100644 (file)
@@ -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
index 706801ed038a9835ebe42dca80086393086a4bd8..c876c8d1ae4b57524e17ac3cd47b2b1e7d2d2ede 100644 (file)
@@ -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
index 7ee763f15cb87da7c53d1cbc68fe10a18aa6168d..b118041c36992b97bbb38655703c0e14d29b66c2 100644 (file)
@@ -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
index a26123e0f68cba45274b0c81d1dbb42e331b5ede..db6ee28d450dafb9457261dfa6f70e40f86f9fc5 100644 (file)
@@ -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
index e3f1ae37ad738d1a7b62195c8012c222220da641..8973af14672ec728a0b1c125d4782bc805d9bb32 100644 (file)
@@ -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
index 86137f6a8e29f35d9746040a233f5a8b83e40f98..cd5e77e6daeeaebbc7c54164581a682f1098cc4e 100644 (file)
@@ -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
index a98463948ce9aaf248f1a631b6588c43abc49c9d..3aa0b24ddda645660f786f2ed26a44033e2741c7 100644 (file)
@@ -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
index 2cc704033680e20a19ebd0cd6dfc10e01a98f13c..f85591e2ff41ca35f1acdbbcd1dcd4ecd5a00c6f 100644 (file)
@@ -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
index 3cb510bfe5b8f60b59676e715d9cba11b5f14041..0623f9a314ce9b32ed9266b922dac97a7c90bedd 100644 (file)
@@ -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
index 56e8ab96d5c2f87077a46aa693b3c1c8bf8b330e..c769d976f8de2fa203aa06af6240f9a58d17ec92 100644 (file)
@@ -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
index f4dcc7479a5d25d9a0598e95fceea22e65600317..70ff0f11723f08aa00d4ef3c1c6a4669e6ef1e4a 100644 (file)
@@ -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
index fbecd155d68f3f05a60d51992259d2e3d5ba573d..5347d0adae4e55465d6560f8961bd7ba09cfe188 100644 (file)
@@ -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
index 0a1939318779b41627f8ecc1ac1be1718d27d5cb..b8a907c1f4bc88e92b885b9fe0d2c969f9cf617c 100644 (file)
@@ -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
index 2fc2c690fdda65b1ce3eec97b4a4d388f2a31227..5185380326b31f3b59f132b8155095c53470b780 100644 (file)
@@ -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
index 678931df49e14dcbe39556a7a293f56a6d14f42e..b5e0a6708968346df936068fd3f4f32628f16254 100644 (file)
@@ -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
index b55e835f666585ad225df7995759b8c997f1f0ab..8b98af8c1884496b69662ef6d06043fc90a6e349 100644 (file)
@@ -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
index 91cd46f7e10140c1667599353ceeb8fc008c78d5..14e52268741d5a410310c4f207fb5963967ca760 100644 (file)
@@ -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
index 9dc2450a85b59e9aadc7292e762fbf3b6625f85b..7284a1b459a3911ae928b2923e141dfa494006e4 100644 (file)
@@ -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
index 27c3c9dc2628e9d5d1cf988806896cb7849a09e5..b2c2a620fae5d41c6dbc2b0768e037e00b63fff5 100644 (file)
@@ -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
index 2a6ce35079f9c3d7f4682373856794e8d860d822..dd473d292c98b3af3ffabc7ab25a9ad7d302ff1e 100644 (file)
@@ -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
index f764b482ef656e572b8ba0cb147be59a9edf0d95..4a682b5bb0efbde8718f862413b0b05d6869fdf9 100644 (file)
@@ -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
index 23d12b0d91b1f29e0f10cc763350fb41d070b183..c0bc77109cc4eac239ec63a78cb364cac397ea7d 100644 (file)
@@ -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
index d2c2efb133ec527dd11e00ea4c2ce240dd58de05..be27c0eee8a15388d4689f228496492a24892be6 100644 (file)
@@ -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
index 0212843b6d520dee7f2ce524df30eedc659b3bc3..2254b908c007b539ad394783540870d1bdf807f0 100644 (file)
@@ -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
index 0f313f31d529c6704721364204bf2ca06a3ebe77..fa48a0a2cfd371de91504ea7781ea33678f9e0a1 100644 (file)
@@ -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
index 958bca77ae26963cb6fc662946ed27e5ee9f4837..3234d431efaef8f3e297d7b306c63cd6a0d8c37a 100644 (file)
@@ -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
index 6cf9d5cc463f2d3019f2a5a732c74ce36156c777..4b0aae8f002ea384c296591f6444553f46262adc 100644 (file)
@@ -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
index a63451b65f49053151a6c72b77ca97fa46327d95..2f8a348ea7c258cb3a44ba29d7ee8f46ab410794 100644 (file)
@@ -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
index 36d011f37b11d7edfc7776d1984850fabfe1fbfd..82608e1cd092ed9dd57a5c7f6c8a870ae9b3e993 100644 (file)
@@ -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
index a137c3beb47db4a7ae7465d806806c178fb60db0..b39556844240da8e1fa523b35a64a1837131a37a 100644 (file)
@@ -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
index 72ec4c63bddf0cbae8e6319be49286cbc7dd4085..0f46635120b109adb60fac6f21eda2703214a0e1 100644 (file)
@@ -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
index 6ea9a67568d2d1f61e886f6583a01731e5419717..97303c9aea01b7e31d7bb8cc26dd30b314b5d33c 100644 (file)
@@ -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
index 75747c5293da637306ddc8e151c4212d0fbf8b8f..e712ba0b8db8ba80d691bdd0dd8061365a7e3a0c 100644 (file)
@@ -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
index 383c54ebe72aea3265ea840cb47e905da14f952c..44d8aa49a32c03a357d527c5e4ce90d7f9ff9e3e 100644 (file)
@@ -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
index 23849bedc6793bd026746727fd72a82db6e90670..cb7378a693c9264c66e8a7b1dca1935ed20aff44 100644 (file)
@@ -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
index b90fe0313567aa6bb521257b5669b95f662c340d..96b388152911685e82ccbd63c00b151c08623fa9 100644 (file)
@@ -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
index f97e2a51b1c3ab2a51e5a851824880d4b90221b3..eb59a37fc38ac996dbeda53b25f196cf78be2d19 100644 (file)
@@ -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
index 4f61909534a3c66367a6e88d614da3bb28ab9baa..f11db4442338ed7a16a832a0da6cd765eced7f84 100644 (file)
@@ -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
index d67fbaea767a4021a2e829a71c888cbf07774955..a880615389e2f1eab07c5894b13d01841a3e4411 100644 (file)
@@ -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
index e5b86bd15801c2f2202e61e7be8fa8b30bc92fee..586e97a5ff326c6d8530272652c081072d52a3b8 100644 (file)
@@ -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
index c77105c95f1c6d13ebc15390770a0a671f6e11ce..d315c817973647d9991aed903f6db75dff71402e 100644 (file)
@@ -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
index ca6a594d7f75f9b8497568019037d57e590cf7e9..247af835cf0418ce08d514f086d39862c0a91eb4 100644 (file)
@@ -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
index 14b47b447c4d1e393ac847eb0fb83a12032d393c..a054313f4815dd0a425b69a19b841195283bb59c 100644 (file)
@@ -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
index c748e2b7d42493b48e5da55c6663d3c2fee0f91d..c03c0cf2053bc36bf08ce25946fa0484f7ae3a88 100644 (file)
@@ -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
index 5c203fa952a66720a27f6e0d87d7eb532e049032..46abe28e6dad7979561becbbc4ab3d80a4ce6820 100644 (file)
@@ -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
index 2aeb2f967dedeb5085bde802a7f501cad2cc3d90..6cae3f78112b8d9a1e47354e67d510a5e024376b 100644 (file)
@@ -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
index 18e12e2791eb0fd3fb237607ac84435896927ed3..6a51fa6b2e7c7707a310302a7f697c7a9ffc0059 100644 (file)
@@ -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
index 23ec58efb3e45c1ec57d8eccec22cf3c8ebded72..2cc4e9cfb8809a0825afe292f1af3f9f89094bc3 100644 (file)
@@ -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
index 3734f1a201c56fc609a97e1d3bc221a86bda14e1..b1264c74b4d67a352e4cc6b9b1e2954915bec0a6 100644 (file)
@@ -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
index 821f206b4934a9e43c94243fbb28f6699a3529ee..100b34895a0a2a0365ea149a3ad9d27e957b6716 100644 (file)
@@ -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
index e490b4d723e0a8172a1a01eb9540ab3c5ef00c51..1056212b8d291f842249f8562220aaaccc511a44 100644 (file)
@@ -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
index 383a278e3d047c38ce0fa56f6a420fd4697f21b2..c429d38d3b489fdc79a854b101e1ed965de4202f 100644 (file)
@@ -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
index 56fb6814bff999042913df6a413f8a1725044c1e..fe304b96d377c7ce11e99649ab369664978d8105 100644 (file)
@@ -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
index d7c0bbff3960ba6f2d48e22f8f29b15a24f9a2a2..1d1422b7bcd73e03ce72f360421198663227a449 100644 (file)
@@ -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
index ad15710d677eb2b25f371f12827a4f2c95a5f2c0..d744ff34b9bc70ed9b70eee2c87d195a0360d3b7 100644 (file)
@@ -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
index 51064af24f4cb077965a551deb7e2d3239f22a7e..d4745cfa2828c4604128e1aa54622b5d1eea7ee7 100644 (file)
@@ -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
index 27f233290b747ce411a077ce6b1c20d862d909a1..257fbabb33c31f16cf718297222bd34be5092b2e 100644 (file)
@@ -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
index 00e702159ba4c09cd416f63f50d4d93b21ed915c..205b911a5ca9b1edae9c13a943a9921789d196a2 100644 (file)
@@ -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
index 20cebc9d09819ccbc33e955b7bf1a8a0a3f80b8b..cb95338d85841f6d9a53c7e194118fd037436a88 100644 (file)
@@ -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
index 9b5accff5a4777277e58428e857c75398c66cb38..194510a1e32e34e7d91dfd48e54280072bc8d6a1 100644 (file)
@@ -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
index b23bf889a119411d068d5434c313607a9037e15b..cf7043dcc0b9d3bb3508a214c5472fdcd3bcc3fa 100644 (file)
@@ -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
index e4ab9e5d6f3b28f1a44cffec663fa8b9313151a4..670e6129d86cf5d74a7a2a911e993d702d9aaed2 100644 (file)
@@ -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
index 9432384e44ef60ca457966806ab2fb46fd42ec7d..aa320f67ae11dc8cf95c2f333a2ba939b780c552 100644 (file)
@@ -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
index bfc75d2da6db4d630f3f835e81eb6268206804a0..748a1c6b3818c5b010096342cd98460b2734c0cb 100644 (file)
@@ -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
index 1b22c6b81ecb36479aa6c80365f6878d237593f5..b2c463a04e638e5cd88c01947cb15b25cc6caa39 100644 (file)
@@ -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
index a2e734581e1236eb3b4aebfc8b7b7618aebc2708..3abaebe480852f2a4aa739a0c0723908174be0a0 100644 (file)
@@ -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
index d1f772fecf157644f95e6e8eb779a55226a4118f..2fe64bc89578dbee6922b35e950c653683a470e7 100644 (file)
@@ -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
index af38ad3552793ca2f408f0604373c1f34c781af9..d62afc9dec6767b23b585b6bb36be72a615b3e54 100644 (file)
@@ -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
index d043013c9aec260a8d69a5884036b839e3691cc1..30c15964f47f7da65df2b58e7d6f83b15ec03733 100644 (file)
@@ -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
index 28a971ab8d2413c7e8c16bfa3ff883056d7d2a63..eadc77987ba5d59c786d6f178271d7f4e8d221f4 100644 (file)
@@ -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
index 6cbb11f36effc5481210f5ca83065146ca6f03bd..e5f1896f245b3b9984f8cc4364d3a2cc3ba88d78 100644 (file)
@@ -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
index 0653f4acdfcbcecce347f7b7349896822a571293..f2e52afd8cc5d7b1b569c5806cccaf76bd09627a 100644 (file)
@@ -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
index 8df62bea370be891521bba1f90256d9232b9a693..8668ad0200be1c2ac579f3fc2c2468b727d94321 100644 (file)
@@ -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
index e1c308da18a53f32fec16a5983304e16d44b3505..2100734567613e8d09fe50bea42b6db03f05ba95 100644 (file)
@@ -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
index c87a867e63113914db59a8ca064df618d41d32ac..9e405a0cc2e85b9b8a0ff261cc124f1f846edb8e 100644 (file)
@@ -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
index 12e67be46f792a179cae6ba688152de18d19c333..49420e6c0f769f4af7c9d2ed407249459d5e2e65 100644 (file)
@@ -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
index 996ab787ba9ab360195b745e7182220402f4027f..a3511943cc92cea6e2bf37f129b66bbb370c3449 100644 (file)
@@ -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
index 9d62d1c0632eaa391a74e95fa5512ef136c06b02..b700e2e2a6fffa1306f67e5213935a9baa0721ec 100644 (file)
@@ -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
index b34b58be4b0cdb9659ef5e241aa5de744f0bd252..3bf32d47eff35b14e696266e4fdd587492a3d165 100644 (file)
@@ -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
index 37b0e3462c7102af850368bc4b17700ccff74ddc..23e460b8e8e4a77ada2de768c3ab5ac3509f6367 100644 (file)
@@ -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
index 0bda1593c88c644bfdeb38558af09bd7ea5444c1..a17f24840021642d6d0a092ba5d89f184c193689 100644 (file)
@@ -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
index 7d5a9245f2aeca77ef2f3040be1f3b1221ffc90c..323005c8e2ce92cedbed0811f1c188cf1d479391 100644 (file)
@@ -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
index 03a402291e602982044fe82af1e50a882acefab4..badcd3fb668fcd7e88f9f61334b0cdcb32b0b252 100644 (file)
@@ -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
index b6ccbbfef11955c5411d1ed547d83b4f588e8901..5233fdaf54cae876d337e641b2922b9ae5abd5ae 100644 (file)
@@ -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
index e783869a9bccff1bd70618bfba849a059c0a0e46..32f7aef3b1d8607f0c81e7c2107132ff4e8cbcda 100644 (file)
@@ -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
index 83be8504c4dfd83230107eb12723c022bc14aff5..079b1bec4a9fd1819484ff11b6e47b56cce766e4 100644 (file)
@@ -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
index 1ad7e544c8a7ec6837dcee8c90574075fee7aed9..0964b378737226bd8a9e36abb7e836006357d302 100644 (file)
@@ -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
index aeca0c65f53313ef2696f2d34383efb2a173bd59..c81c259b0514940476d25df541ef95fa7cc07842 100644 (file)
@@ -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
index 4ed75c7fa5013f44998ee757b3d7db5109ec53e8..47bc025d8299e110e946f12f4d87d68607279b2d 100644 (file)
@@ -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
index 316780e1efeb54b72f043cf1631bb9cb48c851da..737fc0f9a345860b94943c04da9798ba88b754bb 100644 (file)
@@ -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
index b1c9074624bffecd4951d7bb04ad5f842553bdeb..f6d3264d374a744cf7cf155ac4ead44589da770a 100644 (file)
@@ -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
index 08e07262a7c43b8fa69cb8def35a08e3b335712a..9cc57f10128b7828d665a2fffd8add735cef4795 100644 (file)
@@ -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
index 69da423016a13dfdd8cd9a246fb604cd358cd9aa..540c5196534a61fe615bc93dd71ab5017ab56ebc 100644 (file)
@@ -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