From 27c3d986c4e704336c17155c558911beff1e1385 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Tue, 12 May 2020 22:34:50 +0200 Subject: Be prepared for more aggregates in gigi This makes sure that gigi is prepared to handle more aggregates in the special memset code path. * sem_aggr.ads (Is_Single_Aggregate): New function. * sem_aggr.adb (Is_Others_Aggregate): Use local variable. (Is_Single_Aggregate): New function to recognize an aggregate with a single association containing a single choice. * fe.h (Is_Others_Aggregate): Delete. (Is_Single_Aggregate): New declaration. * gcc-interface/trans.c (gnat_to_gnu) : Call Is_Single_Aggregate instead of Is_Others_Aggregate. --- gcc/ada/gcc-interface/trans.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gcc/ada/gcc-interface') diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c index cddeae3..b7a4cad 100644 --- a/gcc/ada/gcc-interface/trans.c +++ b/gcc/ada/gcc-interface/trans.c @@ -7887,7 +7887,7 @@ gnat_to_gnu (Node_Id gnat_node) const bool use_memset_p = regular_array_type_p && Nkind (gnat_inner) == N_Aggregate - && Is_Others_Aggregate (gnat_inner); + && Is_Single_Aggregate (gnat_inner); /* If we use memset, we need to find the innermost expression. */ if (use_memset_p) @@ -7897,7 +7897,7 @@ gnat_to_gnu (Node_Id gnat_node) gnat_temp = Expression (First (Component_Associations (gnat_temp))); } while (Nkind (gnat_temp) == N_Aggregate - && Is_Others_Aggregate (gnat_temp)); + && Is_Single_Aggregate (gnat_temp)); gnu_rhs = gnat_to_gnu (gnat_temp); } else -- cgit v1.1