[Ada] Do not set a bogus Esize on subtype built for Component_Size clause
authorEric Botcazou <ebotcazou@adacore.com>
Mon, 16 Dec 2019 10:35:05 +0000 (10:35 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Mon, 16 Dec 2019 10:35:05 +0000 (10:35 +0000)
2019-12-16  Eric Botcazou  <ebotcazou@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.

From-SVN: r279437

gcc/ada/ChangeLog
gcc/ada/sem_ch13.adb

index 13f7799d03d80572868debb4c2b5352de6c94dae..e47c8382c3b44a22500573df67642a3eaae1efea 100644 (file)
@@ -1,3 +1,9 @@
+2019-12-16  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * 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.
+
 2019-12-16  Arnaud Charlet  <charlet@adacore.com>
 
        * socket.c: Shutdown warning.
index bbdb065908b515fbaa2cffeeeb77d25e46dc63b8..8ca731dc2842e9d3735b0e9ecb6c04a15c55d41c 100644 (file)
@@ -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);