https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127880
--- Comment #3 from Martin Krischik <krischik at users dot sourceforge.net> --- Thank you for the note that the reduced file set is sufficient and that the crash is triggered by -gnata. I tried a few things to narrow it down. Replacing the AdaCL.Pointer.Unique instantiation with a direct instantiation of the underlying AdaCL.Pointer.Unique_With_Delete (and an explicit Unchecked_Deallocation) did not change the behaviour; the compiler still produced the same internal error. What did eliminate the crash was moving the Tasks package out of a separate subunit and into a proper child package. After that change the code compiles cleanly even with -gnata enabled. The original bug location was inside the protected type (Sychronized_Object / Queue), yet the presence of the separate subunit appears to be what triggers the problem. separate is an old feature that is rarely used in modern Ada, so it is possible the front end is mishandling some interaction between a separate subunit and the generic expansion of the unique-pointer / controlled-type machinery when assertions are enabled. I have not yet reduced it further, but the practical workaround is simply to avoid separate for that package. The is of course a reason why I have chosen separates.
