From: Eric Botcazou Date: Sat, 8 Apr 2023 10:43:54 +0000 (+0200) Subject: ada: Call idiomatic routine in Expand_Simple_Function_Return X-Git-Tag: basepoints/gcc-15~8789 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fe8b341f09a13e1dcaa2788f123d69122c5cdea5;p=thirdparty%2Fgcc.git ada: Call idiomatic routine in Expand_Simple_Function_Return 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. --- diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb index 87560462315e..b19db8fb74d5 100644 --- a/gcc/ada/exp_ch6.adb +++ b/gcc/ada/exp_ch6.adb @@ -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 =>