From: pmderodat Date: Tue, 21 Aug 2018 14:46:59 +0000 (+0000) Subject: [Ada] Unnesting: do not set size of access subprograms X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3fb32d240b588bcee09594d3c44e2941c2f4344d;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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263721 138bc75d-0d04-0410-961f-82ee72b054a4 --- 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