https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80784
--- Comment #4 from Eric Botcazou <ebotcazou at gcc dot gnu.org> --- Author: ebotcazou Date: Wed May 17 12:51:00 2017 New Revision: 248152 URL: https://gcc.gnu.org/viewcvs?rev=248152&root=gcc&view=rev Log: PR ada/80784 Backport from mainline 2017-05-02 Ed Schonberg <schonb...@adacore.com> * exp_ch3.adb (Freeze_Type): Do not generate an invariant procedure body for a local (sub)type declaration within a predicate function. Invariant checks do not apply to these, and the expansion of the procedure will happen in the wrong scope, leading to misplaced freeze nodes. Modified: branches/gcc-7-branch/gcc/ada/ChangeLog branches/gcc-7-branch/gcc/ada/exp_ch3.adb