r274298 - in /trunk/gcc: ada/ChangeLog ada/sem_...

pmderodat@gcc.gnu.org pmderodat@gcc.gnu.org
Mon Aug 12 09:07:00 GMT 2019


Author: pmderodat
Date: Mon Aug 12 09:01:04 2019
New Revision: 274298

URL: https://gcc.gnu.org/viewcvs?rev=274298&root=gcc&view=rev
Log:
[Ada] Hang on loop in generic with subtype indication specifying a range

The compiler may hang when a for loop expanded in a generic
instantiation has a range specified by a subtype indication with an
explicit range that has a bound that is an attribute applied to a
discriminant-dependent array component. The Parent field of the bound
may not be set, which can lead to endless looping when an actual subtype
created for the array component is passed to Insert_Actions. This is
fixed by setting the Parent fields of the copied bounds before
Preanalyze is called on them.

2019-08-12  Gary Dismukes  <dismukes@adacore.com>

gcc/ada/

	* sem_ch5.adb (Prepare_Param_Spec_Loop): Set the parents of the
	copied low and high bounds in the case where the loop range is
	given by a discrete_subtype_indication, to prevent hanging (or
	Assert_Failure) in Insert_Actions.

gcc/testsuite/

	* gnat.dg/generic_inst7.adb, gnat.dg/generic_inst7_pkg.adb,
	gnat.dg/generic_inst7_pkg.ads, gnat.dg/generic_inst7_types.ads:
	New testcase.

Added:
    trunk/gcc/testsuite/gnat.dg/generic_inst7.adb
    trunk/gcc/testsuite/gnat.dg/generic_inst7_pkg.adb
    trunk/gcc/testsuite/gnat.dg/generic_inst7_pkg.ads
    trunk/gcc/testsuite/gnat.dg/generic_inst7_types.ads
Modified:
    trunk/gcc/ada/ChangeLog
    trunk/gcc/ada/sem_ch5.adb
    trunk/gcc/testsuite/ChangeLog



More information about the Gcc-cvs mailing list