aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/exp_ch5.adb
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2023-05-17 17:05:14 +0200
committerMarc Poulhiès <poulhies@adacore.com>2023-06-15 09:59:37 +0200
commita8c45d3fba65fa4e83903ffcba678eb497c2b07b (patch)
treefe945ad63ed0e288adffcf563004396842bc2ff1 /gcc/ada/exp_ch5.adb
parent9cdaa52bf8e0529c3d4d13121c440f92113ff05d (diff)
downloadgcc-a8c45d3fba65fa4e83903ffcba678eb497c2b07b.zip
gcc-a8c45d3fba65fa4e83903ffcba678eb497c2b07b.tar.gz
gcc-a8c45d3fba65fa4e83903ffcba678eb497c2b07b.tar.bz2
ada: Fix internal error on loop iterator filter with -gnatVa
The problem is that the condition of the iterator filter is expanded early, before it is integrated into an if statement of the loop body, so there is no place to attach the actions generated by this expansion. This happens only for simple loops, i.e. with a parameter specification, so the fix uses the same approach for them as for loops based on iterators. gcc/ada/ * sinfo.ads (Iterator_Filter): Document field. * sem_ch5.adb (Analyze_Iterator_Specification): Move comment around. (Analyze_Loop_Parameter_Specification): Only preanalyze the iterator filter, if any. * exp_ch5.adb (Expand_N_Loop_Statement): Analyze the new list built when an iterator filter is present.
Diffstat (limited to 'gcc/ada/exp_ch5.adb')
-rw-r--r--gcc/ada/exp_ch5.adb1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/ada/exp_ch5.adb b/gcc/ada/exp_ch5.adb
index a4c7db9..258459b 100644
--- a/gcc/ada/exp_ch5.adb
+++ b/gcc/ada/exp_ch5.adb
@@ -5678,6 +5678,7 @@ package body Exp_Ch5 is
New_List (Make_If_Statement (Loc,
Condition => Iterator_Filter (LPS),
Then_Statements => Stats)));
+ Analyze_List (Statements (N));
end if;
-- Deal with loop over predicates