[Ada] Unnesting: do not set size of access subprograms
authorEd Schonberg <schonberg@adacore.com>
Tue, 21 Aug 2018 14:46:59 +0000 (14:46 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Tue, 21 Aug 2018 14:46:59 +0000 (14:46 +0000)
2018-08-21  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* layout.adb: Do not set size of access subprogram if unnesting.

From-SVN: r263721

gcc/ada/ChangeLog
gcc/ada/layout.adb

index 9737c07239442671a6efe433512502bf2ecc5e5f..dee70642a427d1308229d2d6033b8797b7489682 100644 (file)
@@ -1,3 +1,7 @@
+2018-08-21  Ed Schonberg  <schonberg@adacore.com>
+
+       * layout.adb: Do not set size of access subprogram if unnesting.
+
 2018-08-21  Ed Schonberg  <schonberg@adacore.com>
 
        * freeze.adb: Remove warnings for access to subprograms when
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