diff gcc/ada/layout.adb @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 84e7813d76e9
children
line wrap: on
line diff
--- a/gcc/ada/layout.adb	Thu Oct 25 07:37:49 2018 +0900
+++ b/gcc/ada/layout.adb	Thu Feb 13 11:34:05 2020 +0900
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 2001-2018, Free Software Foundation, Inc.         --
+--          Copyright (C) 2001-2019, Free Software Foundation, Inc.         --
 --                                                                          --
 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
 -- terms of the  GNU General Public License as published  by the Free Soft- --
@@ -435,17 +435,12 @@
             end;
          end if;
 
-         --  If Esize is set, and RM_Size is not, RM_Size is copied from Esize.
-         --  At least for now this seems reasonable, and is in any case needed
-         --  for compatibility with old versions of gigi.
-
-         if Known_Esize (E) and then Unknown_RM_Size (E) then
-            Set_RM_Size (E, Esize (E));
-         end if;
-
-         --  For array base types, set component size if object size of the
+         --  For array base types, set the component size if object size of the
          --  component type is known and is a small power of 2 (8, 16, 32, 64),
-         --  since this is what will always be used.
+         --  since this is what will always be used, except if a very large
+         --  alignment was specified and so Adjust_Esize_For_Alignment gave up
+         --  because, in this case, the object size is not a multiple of the
+         --  alignment and, therefore, cannot be the component size.
 
          if Ekind (E) = E_Array_Type and then Unknown_Component_Size (E) then
             declare
@@ -458,6 +453,9 @@
                if Present (CT)
                  and then Is_Scalar_Type (CT)
                  and then Known_Static_Esize (CT)
+                 and then not (Known_Alignment (CT)
+                                and then Alignment_In_Bits (CT) >
+                                           Standard_Long_Long_Integer_Size)
                then
                   declare
                      S : constant Uint := Esize (CT);
@@ -758,9 +756,9 @@
          end if;
 
          --  Check components. If any component requires a higher alignment,
-         --  then we set that higher alignment in any case. Don't do this if
-         --  we have Optimize_Alignment set to Space. Note that that covers
-         --  the case of packed records, where we already set alignment to 1.
+         --  then we set that higher alignment in any case. Don't do this if we
+         --  have Optimize_Alignment set to Space. Note that covers the case of
+         --  packed records, where we already set alignment to 1.
 
          if not Optimize_Alignment_Space (E) then
             declare