From: Ed Schonberg Date: Tue, 21 Aug 2018 14:46:59 +0000 (+0000) Subject: [Ada] Unnesting: do not set size of access subprograms X-Git-Tag: basepoints/gcc-10~4639 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5c0972ba85975672ae89ce70a562133a506689d1;p=thirdparty%2Fgcc.git [Ada] Unnesting: do not set size of access subprograms 2018-08-21 Ed Schonberg gcc/ada/ * layout.adb: Do not set size of access subprogram if unnesting. From-SVN: r263721 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 9737c0723944..dee70642a427 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,7 @@ +2018-08-21 Ed Schonberg + + * layout.adb: Do not set size of access subprogram if unnesting. + 2018-08-21 Ed Schonberg * freeze.adb: Remove warnings for access to subprograms when diff --git a/gcc/ada/layout.adb b/gcc/ada/layout.adb index 6b77757b9b22..23436c8dfd8c 100644 --- a/gcc/ada/layout.adb +++ b/gcc/ada/layout.adb @@ -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