From: Arnaud Charlet Date: Mon, 2 Mar 2020 08:58:02 +0000 (-0500) Subject: [Ada] Improve handling of aggregates in Side_Effect_Free X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c4609e75ef41546d7b7373cc3d6d0ba9fa15dfcd;p=gcc.git [Ada] Improve handling of aggregates in Side_Effect_Free 2020-06-09 Arnaud Charlet gcc/ada/ * exp_util.adb (Side_Effect_Free): Improve handling of N_Aggregate. --- diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb index 87abe9a6830..91d5c8131ee 100644 --- a/gcc/ada/exp_util.adb +++ b/gcc/ada/exp_util.adb @@ -13357,6 +13357,12 @@ package body Exp_Util is => return True; + -- An aggregate is side effect free if all its values are compile + -- time known. + + when N_Aggregate => + return Compile_Time_Known_Aggregate (N); + -- We consider that anything else has side effects. This is a bit -- crude, but we are pretty close for most common cases, and we -- are certainly correct (i.e. we never return True when the