[Ada] Hang on expansion of library-level instantiation
authorJustin Squirek <squirek@adacore.com>
Thu, 4 Jul 2019 08:05:55 +0000 (08:05 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Thu, 4 Jul 2019 08:05:55 +0000 (08:05 +0000)
commit7273107b948b81edc084b33e8e8fd4f3b4115f72
treec9317e9bb0f4b3b08397a1108a842e13cf3763a4
parentc3c41b296a71e77742d3edb3494945537cd72983
[Ada] Hang on expansion of library-level instantiation

This patch fixes an issue whereby instantiation of a generic at the
library-level may cause a hang or crash during compilation due to
inappropriate expansion of generic actuals.

2019-07-04  Justin Squirek  <squirek@adacore.com>

gcc/ada/

* sem_ch12.adb (Perform_Appropriate_Analysis): Added for
selecting which type of analysis based on wheither the
instantiation is a generic at the library-level. In which case
expansion during analysis.
(Preanalyze_Actuals): Modify calls to Analyze to use the new
routine.

gcc/testsuite/

* gnat.dg/generic_inst4.adb, gnat.dg/generic_inst4_gen.ads,
gnat.dg/generic_inst4_inst.ads, gnat.dg/generic_inst4_typ.ads:
New testcase.

From-SVN: r273054
gcc/ada/ChangeLog
gcc/ada/sem_ch12.adb
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/generic_inst4.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/generic_inst4_gen.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/generic_inst4_inst.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/generic_inst4_typ.ads [new file with mode: 0644]