This fixes a small glitch in the handling of Component_Size clauses:
when the component type is a biased integer type, the compiler builds
a subtype with the size prescribed by the clause, but sets it both as
the Esize and the RM_Size of this subtype.  Now this size might not be
a multiple of the storage unit, which is problematic for the Esize.

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

2019-12-16  Eric Botcazou  <ebotca...@adacore.com>

gcc/ada/

        * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Set only
        the RM_Size on the subtype built for a Component_Size clause
        when the component type is a biased integer type.
--- gcc/ada/sem_ch13.adb
+++ gcc/ada/sem_ch13.adb
@@ -5476,7 +5476,7 @@ package body Sem_Ch13 is
                   Analyze (Decl, Suppress => All_Checks);
 
                   Set_Has_Delayed_Freeze        (New_Ctyp, False);
-                  Set_Esize                     (New_Ctyp, Csize);
+                  Init_Esize                    (New_Ctyp);
                   Set_RM_Size                   (New_Ctyp, Csize);
                   Init_Alignment                (New_Ctyp);
                   Set_Is_Itype                  (New_Ctyp, True);

Reply via email to