[Ada] Spurious elaboration issue due to inlining

Pierre-Marie de Rodat derodat@adacore.com
Wed Sep 26 09:26:00 GMT 2018


This patch ensures that the full compilation context is captured prior
to package or subprogram instantiation/inlining and restored after the
action takes place.

Tested on x86_64-pc-linux-gnu, committed on trunk

2018-09-26  Hristian Kirtchev  <kirtchev@adacore.com>

gcc/ada/

	* sem_ch12.adb (Instantiate_Package_Body): Capture and restore
	the full compilation context.
	(Instantiate_Subprogram_Body): Capture and restore the full
	compilation context.

gcc/testsuite/

	* gnat.dg/elab7.adb, gnat.dg/elab7_pkg1.adb,
	gnat.dg/elab7_pkg1.ads, gnat.dg/elab7_pkg2.adb,
	gnat.dg/elab7_pkg2.ads: New testcase.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-diff
Size: 10277 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20180926/0ae1bf13/attachment.bin>


More information about the Gcc-patches mailing list