From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1285) id 1B5A53875DE3; Wed, 27 Sep 2023 08:28:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1B5A53875DE3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1695803327; bh=+XevcOo0uYMO8HgO8N7DXNv9sie8Z5bb2ZCzuxIO/cI=; h=From:To:Subject:Date:From; b=cavpOYxjGjc4iopKxpgqwggCoeELAkJFfJpT9Us4dF1UnAQ+1JjSvaLuWQmKSejFS hwmfVF0AdMHmQ7QvIZLqaK/odsSZDs39E60PM+zn5iG/gpgecrZPBKlHVeMakl113/ ZdeST69gljlx4Ihrk+16br5A/TinXTp0tdKpoRv4= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Eric Botcazou To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-7909] ada: Fix wrong optimization of extended return for discriminated record type X-Act-Checkin: gcc X-Git-Author: Eric Botcazou X-Git-Refname: refs/heads/releases/gcc-13 X-Git-Oldrev: a44435c1d2e1c13dd5ba60ad38feec7f7b1899da X-Git-Newrev: 1c135ab169fd6924292258ab107732b565ee1ee3 Message-Id: <20230927082847.1B5A53875DE3@sourceware.org> Date: Wed, 27 Sep 2023 08:28:47 +0000 (GMT) List-Id: https://gcc.gnu.org/g:1c135ab169fd6924292258ab107732b565ee1ee3 commit r13-7909-g1c135ab169fd6924292258ab107732b565ee1ee3 Author: Eric Botcazou Date: Thu Sep 7 16:44:36 2023 +0200 ada: Fix wrong optimization of extended return for discriminated record type This happens when the discriminants of the record type have default values. gcc/ada/ChangeLog: * inline.adb (Expand_Inlined_Call): In the case of a function call that returns an unconstrained type and initializes an object, set the No_Initialization flag on the new declaration of the object. Diff: --- gcc/ada/inline.adb | 1 + 1 file changed, 1 insertion(+) diff --git a/gcc/ada/inline.adb b/gcc/ada/inline.adb index c3911cf70e8..598668b0e55 100644 --- a/gcc/ada/inline.adb +++ b/gcc/ada/inline.adb @@ -4105,6 +4105,7 @@ package body Inline is Object_Definition => New_Copy_Tree (Object_Definition (Parent (Targ1)))); Replace_Formals (Decl); + Set_No_Initialization (Decl); Rewrite (Parent (N), Decl); Analyze (Parent (N));