aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@adacore.com>2020-12-10 11:22:23 -0500
committerPierre-Marie de Rodat <derodat@adacore.com>2021-04-28 05:38:18 -0400
commit5485d0e5569037c0bdc04192e174a048f7d69a61 (patch)
tree4382ba482e0d8c6548a06ed7c003030b7fd15b83 /gcc/ada
parent4e60fea9206696782e2292419da9add02d0b609c (diff)
downloadgcc-5485d0e5569037c0bdc04192e174a048f7d69a61.zip
gcc-5485d0e5569037c0bdc04192e174a048f7d69a61.tar.gz
gcc-5485d0e5569037c0bdc04192e174a048f7d69a61.tar.bz2
[Ada] Fix recent optimization in evaluation of selected component for GNATprove
gcc/ada/ * sem_eval.adb (Eval_Selected_Component): Only consider compile time known aggregates.
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/sem_eval.adb4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/ada/sem_eval.adb b/gcc/ada/sem_eval.adb
index 7b1e48d..3ccf3a0 100644
--- a/gcc/ada/sem_eval.adb
+++ b/gcc/ada/sem_eval.adb
@@ -3849,7 +3849,9 @@ package body Sem_Eval is
Node := Unqualify (Prefix (N));
- if Nkind (Node) = N_Aggregate then
+ if Nkind (Node) = N_Aggregate
+ and then Compile_Time_Known_Aggregate (Node)
+ then
Comp := First (Component_Associations (Node));
Nam := Chars (Selector_Name (N));