From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6D8BA3858D1E; Thu, 9 Nov 2023 15:01:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6D8BA3858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1699542063; bh=hHKITQKqshhMp0R3xOcfwS7njnFEJkcTXxPc4Fu/b/g=; h=From:To:Subject:Date:From; b=WZl/UTUaXyv8jLIicDrHoHIDBb+mXXKUrNWglS+oLq7pHUROKwfbjmXt8aXfNv14n CrkGODJezPPSp+17UPdRuxK+KwkSZ62vWAXyB6T0kzAkW5vmxSkbNuux97kvstIt7e iyuewOeUTRenn+PS5FO23UJ8fjLDL7lNOblzsqRE= From: "simon at pushface dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ada/112461] New: [14 regression] Simple return inside extended return loses updates to return object value Date: Thu, 09 Nov 2023 15:01:03 +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: 14.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 cc target_milestone 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D112461 Bug ID: 112461 Summary: [14 regression] Simple return inside extended return loses updates to return object value Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: ada Assignee: unassigned at gcc dot gnu.org Reporter: simon at pushface dot org CC: dkm at gcc dot gnu.org Target Milestone: --- In a complicated extended return[1] with this structure -- Calculate the sum of the natural numbers up to & including the -- given limit. function Add (Up_To : Natural) return Natural is Round : Natural :=3D 0; begin return Result : Natural :=3D 0 do loop Result :=3D Result + Round; if Round =3D Up_To then return; end if; Round :=3D Round + 1; end loop; end return; end Add; what was returned was the equivalent of the initial value (here, 0) rather= =20 than the value as updated in the loop (NB! this simple loop doesn=E2=80=99t= fail,=20 I only include it as an example, since I don=E2=80=99t have a simple reprod= ucer). The problem was introduced after 20231008. [1] https://github.com/alire-project/alire/blob/a69ac7c7a24590bdfe1ca77bcb60386= 551989696/src/alire/alire-properties-from_toml.adb#L14=