[Ada] Unnesting: do not set size of access subprograms
[gcc.git] / gcc / ada / layout.adb
index 6b77757b9b22f712446195e739b67aaf0abad7a0..23436c8dfd8cace91440c43b6b757464de363152 100644 (file)
@@ -325,6 +325,17 @@ package body Layout is
          then
             Init_Size (E, 2 * System_Address_Size);
 
+         --  If unnesting subprograms, subprogram access types contain the
+         --  address of both the subprogram and an activation record.  But
+         --  if we set that, we'll get a warning on different unchecked
+         --  conversion sizes in the RTS.  So leave unset ub that case.
+
+         elsif Unnest_Subprogram_Mode
+           and then Is_Access_Subprogram_Type (E)
+         then
+            --  Init_Size (E, 2 * System_Address_Size);
+            null;
+
          --  Normal case of thin pointer
 
          else