From b3ad829bd17861251de97b58bb487978b14a0652 Mon Sep 17 00:00:00 2001 From: Ghjuvan Lacambre Date: Wed, 23 Sep 2020 09:33:54 +0200 Subject: [PATCH] [Ada] CUDA: handle parameter associations in expansion of CUDA_Execute gcc/ada/ * exp_prag.adb (Append_Copies): Handle N_Parameter_Associations. --- gcc/ada/exp_prag.adb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/gcc/ada/exp_prag.adb b/gcc/ada/exp_prag.adb index 14ccac9..53e2d97 100644 --- a/gcc/ada/exp_prag.adb +++ b/gcc/ada/exp_prag.adb @@ -778,16 +778,23 @@ package body Exp_Prag is is Copy : Entity_Id; Param : Node_Id; + Expr : Node_Id; begin Param := First (Params); while Present (Param) loop Copy := Make_Temporary (Loc, 'C'); + if Nkind (Param) = N_Parameter_Association then + Expr := Explicit_Actual_Parameter (Param); + else + Expr := Param; + end if; + Append_To (Decls, Make_Object_Declaration (Loc, Defining_Identifier => Copy, - Object_Definition => New_Occurrence_Of (Etype (Param), Loc), - Expression => New_Copy_Tree (Param))); + Object_Definition => New_Occurrence_Of (Etype (Expr), Loc), + Expression => New_Copy_Tree (Expr))); Append_Elmt (Copy, Copies); Next (Param); -- 2.7.4