]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Call idiomatic routine in Expand_Simple_Function_Return
authorEric Botcazou <ebotcazou@adacore.com>
Sat, 8 Apr 2023 10:43:54 +0000 (12:43 +0200)
committerEric Botcazou <ebotcazou@adacore.com>
Wed, 27 Sep 2023 08:16:27 +0000 (10:16 +0200)
In the primary stack case, Insert_Actions is invoked when the expression is
being rewritten, whereas Insert_List_Before_And_Analyze is invoked in the
secondary stack case.  The former is idiomatic, the latter is not.

gcc/ada/

* exp_ch6.adb (Expand_Simple_Function_Return): Call Insert_Actions
consistently when rewriting the expression.

gcc/ada/exp_ch6.adb

index aee67d4546b2eb2c813b9f2ddbcf52e29747b4bb..81362ad571c1a48f563c947b332e56c01e49c583 100644 (file)
@@ -6830,7 +6830,7 @@ package body Exp_Ch6 is
 
                Temp := Make_Temporary (Loc, 'R', Alloc_Node);
 
-               Insert_List_Before_And_Analyze (N, New_List (
+               Insert_Actions (Exp, New_List (
                  Make_Full_Type_Declaration (Loc,
                    Defining_Identifier => Acc_Typ,
                    Type_Definition     =>