This changes the type set on bit references made to packed arrays:
instead of Universal_Integer, it is set to Standard.Natural.

The reason is that Universal_Integer must be a type as large as the
largest supported integer type and, therefore, can be much larger than
what is really needed here.

No functional changes.

Tested on x86_64-pc-linux-gnu, committed on trunk

2020-06-02  Eric Botcazou  <ebotca...@adacore.com>

gcc/ada/

        * exp_pakd.adb (Expand_Packed_Bit_Reference): Change type of
        reference from Universal_Integer to Standard_Natural.
--- gcc/ada/exp_pakd.adb
+++ gcc/ada/exp_pakd.adb
@@ -1520,12 +1520,12 @@ package body Exp_Pakd is
       Get_Base_And_Bit_Offset (Prefix (N), Base, Offset);
 
       Rewrite (N,
-        Unchecked_Convert_To (Universal_Integer,
+        Unchecked_Convert_To (Standard_Natural,
           Make_Op_Mod (Loc,
             Left_Opnd => Offset,
             Right_Opnd => Make_Integer_Literal (Loc, System_Storage_Unit))));
 
-      Analyze_And_Resolve (N, Universal_Integer);
+      Analyze_And_Resolve (N, Standard_Natural);
    end Expand_Packed_Bit_Reference;
 
    ------------------------------------

Reply via email to