diff options
author | Ed Schonberg <schonberg@adacore.com> | 2018-12-11 11:12:21 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2018-12-11 11:12:21 +0000 |
commit | c13269965084ccb19233411164b52c7f187a5fb6 (patch) | |
tree | 5a7082978db677b3f2f747204dd384466001007d /gcc | |
parent | 2f42b6ead47da2c5d863042de6689aee64d342b3 (diff) | |
download | gcc-c13269965084ccb19233411164b52c7f187a5fb6.zip gcc-c13269965084ccb19233411164b52c7f187a5fb6.tar.gz gcc-c13269965084ccb19233411164b52c7f187a5fb6.tar.bz2 |
[Ada] Unnesting: do not eliminate subprogram whose address is taken
2018-12-11 Ed Schonberg <schonberg@adacore.com>
gcc/ada/
* exp_unst.adb (Register_Subprogram): A subprogram whose address
is taken (through attribute Address or Access) is reachable and
cannot be eliminated, even if there is no explicit call to it:
the address may be used in an indirect call or in some
address-related operation.
From-SVN: r267014
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/ada/exp_unst.adb | 3 |
2 files changed, 10 insertions, 1 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 59d0a3f..b162623 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,5 +1,13 @@ 2018-12-11 Ed Schonberg <schonberg@adacore.com> + * exp_unst.adb (Register_Subprogram): A subprogram whose address + is taken (through attribute Address or Access) is reachable and + cannot be eliminated, even if there is no explicit call to it: + the address may be used in an indirect call or in some + address-related operation. + +2018-12-11 Ed Schonberg <schonberg@adacore.com> + * sem_util.adb (Get_Actual_Subtype): Function can return type mark. (Get_Cursor_Type): Improve recovery and error message on a diff --git a/gcc/ada/exp_unst.adb b/gcc/ada/exp_unst.adb index f8c8fd5..a004b49 100644 --- a/gcc/ada/exp_unst.adb +++ b/gcc/ada/exp_unst.adb @@ -770,7 +770,8 @@ package body Exp_Unst is ((Ent => E, Bod => Bod, Lev => L, - Reachable => In_Synchronized_Unit (E), + Reachable => In_Synchronized_Unit (E) + or else Address_Taken (E), Uplevel_Ref => L, Declares_AREC => False, Uents => No_Elist, |