[gcc r11-1105] [Ada] Improve handling of aggregates in Side_Effect_Free

Pierre-Marie de Rodat pmderodat@gcc.gnu.org
Tue Jun 9 08:11:48 GMT 2020


https://gcc.gnu.org/g:c4609e75ef41546d7b7373cc3d6d0ba9fa15dfcd

commit r11-1105-gc4609e75ef41546d7b7373cc3d6d0ba9fa15dfcd
Author: Arnaud Charlet <charlet@adacore.com>
Date:   Mon Mar 2 03:58:02 2020 -0500

    [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.

Diff:
---
 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


More information about the Gcc-cvs mailing list