]> gcc.gnu.org Git - gcc.git/commitdiff
ada: Fix wrong optimization of extended return for discriminated record type
authorEric Botcazou <ebotcazou@adacore.com>
Thu, 7 Sep 2023 14:44:36 +0000 (16:44 +0200)
committerMarc Poulhiès <poulhies@adacore.com>
Fri, 15 Sep 2023 13:01:30 +0000 (15:01 +0200)
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.

gcc/ada/inline.adb

index db8b4164e877eb919dce8a4d7c42c11898a1c64a..4e8d0f1bb7496a5bd63e2e67f84a9bcf5b7fcb4e 100644 (file)
@@ -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));
 
This page took 0.060834 seconds and 5 git commands to generate.