From c4609e75ef41546d7b7373cc3d6d0ba9fa15dfcd Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Mon, 2 Mar 2020 03:58:02 -0500 Subject: [PATCH] [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. --- gcc/ada/exp_util.adb | 6 ++++++ 1 file changed, 6 insertions(+) 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 -- 2.30.2