From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1E9C83954C6C; Wed, 3 Mar 2021 11:55:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1E9C83954C6C From: "simon at pushface dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ada/99360] New: ICE in generalized iteration Date: Wed, 03 Mar 2021 11:55:44 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ada X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: simon at pushface dot org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 11:55:45 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99360 Bug ID: 99360 Summary: ICE in generalized iteration Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: ada Assignee: unassigned at gcc dot gnu.org Reporter: simon at pushface dot org Target Milestone: --- Created attachment 50292 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D50292&action=3Dedit Reproducer This is a regression from GCC 10. It arises when compiling a generalized iteration (in the case of the bug box below, 'for Cursor in V.Iterate loop', also for existential & universal quantifiers) against an independently-developed arm-eabi RTS[1]. It does *not* happen against f.e. ravenscar-full-stm32f4. This is the result of compiling with the native compiler against the set of files reported by the arm-eabi compiler (attached): $ gnatmake -c -u -f iteration.adb gcc -c iteration.adb +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3DGNAT BUG DETECTED=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+ | 11.0.0 20210205 (experimental) (x86_64-apple-darwin15) Program_Error sem_ch8.adb:5490 explicit raise| | Error detected at iteration.adb:13:8 | | Please submit a bug report; see https://gcc.gnu.org/bugs/ . | | Use a subject line meaningful to you and us to track the bug. | | Include the entire contents of this bug box in the report. | | Include the exact command that you entered. | | Also include sources listed below. | +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+ Please include these source files with error report Note that list may not be accurate in some cases, so please double check that the problem can still be reproduced with the set of files listed. Consider also -gnatd.n switch (see debug.adb). system.ads iteration.adb ada.ads a-contai.ads a-cobove.ads a-iteint.ads a-stream.ads a-tags.ads s-stoele.ads s-secsta.ads s-parame.ads s-taskin.ads s-freert.ads interfac.ads s-fretas.ads s-stratt.ads s-unstyp.ads What investigation I've been able to do suggests that it's possibly related to tasking and/or finalization being brought in when not needed (it used not to be with GCC 10). Emmanuel B. (ex-AdaCore) said in [2]: Might be unrelated, but: we have noticed recently that a generalized iteration ("for..of") was wrongly calling `activate_task`. In particular, this resulted in errors when executing such loops from a protected object and enabling the checks that no potentially blocking operation is executed in such contexts. We reported this to AdaCore who fixed it in their more recent wavefronts. I am not sure when the error started to occur though, so maybe not that helpful to you :-) ---- [1] https://github.com/simonjwright/cortex-gnat-rts [2] https://groups.google.com/g/comp.lang.ada/c/c5qncqgkgYk/m/Cp-mty5wAgAJ=