[Ada] Crash processing sources under GNATprove debug mode
authorJavier Miranda <miranda@adacore.com>
Mon, 16 Jul 2018 14:10:27 +0000 (14:10 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Mon, 16 Jul 2018 14:10:27 +0000 (14:10 +0000)
commita3b7645bffbaf3dadf1f9cfccd93c6fba3e0834d
treeefe83c064e59079cd0bcf4b9b0fa565d139baf18
parentc4ea29786f9b6e63c47daddfb6bff5b690e5f555
[Ada] Crash processing sources under GNATprove debug mode

Processing sources under -gnatd.F the frontend may crash on
an iterator of the form 'for X of ...' over an array if the
iterator is located in an inlined subprogram.

2018-07-16  Javier Miranda  <miranda@adacore.com>

gcc/ada/

* exp_ch5.adb (Expand_Iterator_Loop_Over_Array): Code cleanup. Required
to avoid generating an ill-formed tree that confuses gnatprove causing
it to blowup.

gcc/testsuite/

* gnat.dg/iter2.adb, gnat.dg/iter2.ads: New testcase.

From-SVN: r262707
gcc/ada/ChangeLog
gcc/ada/exp_ch5.adb
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/iter2.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/iter2.ads [new file with mode: 0644]