[Ada] Compiler loop on expression function and predicate in generic unit
authorEd Schonberg <schonberg@adacore.com>
Fri, 25 May 2018 09:03:04 +0000 (09:03 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Fri, 25 May 2018 09:03:04 +0000 (09:03 +0000)
commit8218cfde96a4e9df2ce00fabc3d616d6f3cfc83c
tree6a7069f514a341e95de7b5860bd3f0b53386e4a5
parent56ce7e4aa9cfbeb2df1a02a4ae899faaeedb2ab4
[Ada] Compiler loop on expression function and predicate in generic unit

This patch fixes an infinite loop in the compiler when analyzing an
expression function whose expression mentions a subtype with a static
predicate, and the context is a generic unit.

2018-05-25  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* sem_ch13.adb (Build_Predicate_Functions): The predicate function
declaration is inserted into the tree and analyzed at that point, so
should not be reinserted when the body is constructed. Inside a
generic, ensure that the body is not inserted twice in the tree.

gcc/testsuite/

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

From-SVN: r260716
gcc/ada/ChangeLog
gcc/ada/sem_ch13.adb
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/static_pred1.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/static_pred1.ads [new file with mode: 0644]