Exp_Util.Find_Hook_Context wasn't prepared to handle this case properly
and we ended up inserting a statement in the middle of an aggregate,
causing chaos.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* exp_util.adb (Find_Hook_Context): Do not stop on an aggregate
node.
diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb
--- a/gcc/ada/exp_util.adb
+++ b/gcc/ada/exp_util.adb
@@ -6220,6 +6220,9 @@ package body Exp_Util is
| N_Discriminant_Association
| N_Parameter_Association
| N_Pragma_Argument_Association
+ | N_Aggregate
+ | N_Delta_Aggregate
+ | N_Extension_Aggregate
and then Nkind (Parent (Par)) not in N_Function_Call
| N_Procedure_Call_Statement
| N_Entry_Call_Statement