aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@adacore.com>2020-03-02 03:58:02 -0500
committerPierre-Marie de Rodat <derodat@adacore.com>2020-06-09 04:09:05 -0400
commitc4609e75ef41546d7b7373cc3d6d0ba9fa15dfcd (patch)
tree49bc191692d1f9cf9e26e65e61dfe1f31dbc1c7f /gcc
parent10212bd8f06e0f8577e15883cae6f9b7c5f381d8 (diff)
downloadgcc-c4609e75ef41546d7b7373cc3d6d0ba9fa15dfcd.zip
gcc-c4609e75ef41546d7b7373cc3d6d0ba9fa15dfcd.tar.gz
gcc-c4609e75ef41546d7b7373cc3d6d0ba9fa15dfcd.tar.bz2
[Ada] Improve handling of aggregates in Side_Effect_Free
2020-06-09 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * exp_util.adb (Side_Effect_Free): Improve handling of N_Aggregate.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/exp_util.adb6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb
index 87abe9a..91d5c81 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