aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorGary Dismukes <dismukes@adacore.com>2019-08-12 09:01:04 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2019-08-12 09:01:04 +0000
commitecb2f4fe0078a1439b80356459ce0c97edfbc30a (patch)
tree4cc6365c441bc719c4f9725021309fec59337545 /gcc/fortran
parent6ab24ed7528b0375c49e4416f825a90bdca63454 (diff)
downloadgcc-ecb2f4fe0078a1439b80356459ce0c97edfbc30a.zip
gcc-ecb2f4fe0078a1439b80356459ce0c97edfbc30a.tar.gz
gcc-ecb2f4fe0078a1439b80356459ce0c97edfbc30a.tar.bz2
[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. From-SVN: r274298
Diffstat (limited to 'gcc/fortran')
0 files changed, 0 insertions, 0 deletions