From 5c0972ba85975672ae89ce70a562133a506689d1 Mon Sep 17 00:00:00 2001 From: Ed Schonberg Date: Tue, 21 Aug 2018 14:46:59 +0000 Subject: [PATCH] [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 --- gcc/ada/ChangeLog | 4 ++++ gcc/ada/layout.adb | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 9737c072394..dee70642a42 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 6b77757b9b2..23436c8dfd8 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 -- 2.30.2