* [COMMITTED] ada: Fix crash on inlining in GNATprove
@ 2023-06-20 11:26 Marc Poulhiès
0 siblings, 0 replies; only message in thread
From: Marc Poulhiès @ 2023-06-20 11:26 UTC (permalink / raw)
To: gcc-patches; +Cc: Yannick Moy
From: Yannick Moy <moy@adacore.com>
After the recent change on detection of non-inlining, calls inside
the iterator part of a quantified expression were not considered
as preventing inlining anymore, leading to a crash later on inside
GNATprove. Now fixed.
gcc/ada/
* sem_res.adb (Resolve_Call): Fix change that replaced test for
quantified expressions by the test for potentially unevaluated
contexts. Both should be performed.
Tested on x86_64-pc-linux-gnu, committed on master.
---
gcc/ada/sem_res.adb | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index f4dfc041cd6..2c8efec524b 100644
--- a/gcc/ada/sem_res.adb
+++ b/gcc/ada/sem_res.adb
@@ -7300,6 +7300,15 @@ package body Sem_Res is
("cannot inline & (in potentially unevaluated context)?",
N, Nam_UA);
+ -- Calls are not inlined inside the loop_parameter_specification
+ -- or iterator_specification of the quantified expression, as they
+ -- are only preanalyzed. Calls in the predicate part are handled
+ -- by the previous test on potentially unevaluated expressions.
+
+ elsif In_Quantified_Expression (N) then
+ Cannot_Inline
+ ("cannot inline & (in quantified expression)?", N, Nam_UA);
+
-- Inlining should not be performed during preanalysis
elsif Full_Analysis then
--
2.40.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-06-20 11:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-20 11:26 [COMMITTED] ada: Fix crash on inlining in GNATprove Marc Poulhiès
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).