2
0
mirror of git://gcc.gnu.org/git/gcc.git synced 2025-03-20 17:40:46 +08:00

[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
This commit is contained in:
Ed Schonberg 2018-12-11 11:12:21 +00:00 committed by Pierre-Marie de Rodat
parent 2f42b6ead4
commit c132699650
2 changed files with 10 additions and 1 deletions

@ -1,3 +1,11 @@
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

@ -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,