public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-4031] ada: Fix wrong optimization of extended return for discriminated record type
@ 2023-09-15 13:05 Marc Poulhi?s
  0 siblings, 0 replies; only message in thread
From: Marc Poulhi?s @ 2023-09-15 13:05 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:b96446e0d0afd0d817f6206efabb1deed4e1ed8e

commit r14-4031-gb96446e0d0afd0d817f6206efabb1deed4e1ed8e
Author: Eric Botcazou <ebotcazou@adacore.com>
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 db8b4164e87..4e8d0f1bb74 100644
--- a/gcc/ada/inline.adb
+++ b/gcc/ada/inline.adb
@@ -4157,6 +4157,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));

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-09-15 13:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-15 13:05 [gcc r14-4031] ada: Fix wrong optimization of extended return for discriminated record type Marc Poulhi?s

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).