public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [COMMITTED] ada: Emit SCOs for nested decisions in quantified expressions
@ 2023-08-01  8:07 Marc Poulhiès
  0 siblings, 0 replies; only message in thread
From: Marc Poulhiès @ 2023-08-01  8:07 UTC (permalink / raw)
  To: gcc-patches; +Cc: Léo Creuse

From: Léo Creuse <creuse@adacore.com>

The tree traversal for decision SCO emission did not recurse in the
iterator specification or loop parameter specification of quantified
expressions, resulting in missing coverage obligations for nested
decisions. This change fixes this by traversing all the attributes
of quantified expressions nodes.

gcc/ada/

	* par_sco.adb (Process_Decisions): Traverse all attributes of
	quantified expressions nodes.

Tested on x86_64-pc-linux-gnu, committed on master.

---
 gcc/ada/par_sco.adb | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/gcc/ada/par_sco.adb b/gcc/ada/par_sco.adb
index ce7de7f3d79..5e65fa25de1 100644
--- a/gcc/ada/par_sco.adb
+++ b/gcc/ada/par_sco.adb
@@ -829,8 +829,15 @@ package body Par_SCO is
 
             when N_Quantified_Expression =>
                declare
-                  Cond : constant Node_Id := Condition (N);
+                  Cond   : constant Node_Id := Condition (N);
+                  I_Spec : Node_Id := Empty;
                begin
+                  if Present (Iterator_Specification (N)) then
+                     I_Spec := Iterator_Specification (N);
+                  else
+                     I_Spec := Loop_Parameter_Specification (N);
+                  end if;
+                  Process_Decisions (I_Spec, 'X', Pragma_Sloc);
                   Process_Decisions (Cond, 'W', Pragma_Sloc);
                   return Skip;
                end;
-- 
2.40.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-08-01  8:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-01  8:07 [COMMITTED] ada: Emit SCOs for nested decisions in quantified expressions 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).