]> 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)
committerMarc Poulhiès <poulhies@adacore.com>
Mon, 29 May 2023 08:23:22 +0000 (10:23 +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 87560462315ef4fa3e5370fa74155fd6cf5c3c54..b19db8fb74d5926e02fc5c29b08162500fd51151 100644 (file)
@@ -6895,7 +6895,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     =>