public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r15-423] ada: Remove code that expected pre/post being split into conjuncts
@ 2024-05-13 8:38 Marc Poulhi?s
0 siblings, 0 replies; only message in thread
From: Marc Poulhi?s @ 2024-05-13 8:38 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:51b84f23b551d12e237290d3fe6311ffbe7bdc0c
commit r15-423-g51b84f23b551d12e237290d3fe6311ffbe7bdc0c
Author: Piotr Trojanek <trojanek@adacore.com>
Date: Mon Feb 5 13:18:50 2024 +0100
ada: Remove code that expected pre/post being split into conjuncts
The removed code is no longer needed (and causes assertion failures).
Most likely it should have been using the Split_PPC flag.
gcc/ada/
* sem_util.adb (Is_Potentially_Unevaluated): Remove code for
recovering the original structure of expressions with AND THEN.
Diff:
---
gcc/ada/sem_util.adb | 29 ++---------------------------
1 file changed, 2 insertions(+), 27 deletions(-)
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index 1166c68b9727..b5c33638b35f 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -19582,39 +19582,14 @@ package body Sem_Util is
-- Local variables
- Par : Node_Id;
Expr : Node_Id;
+ Par : Node_Id;
-- Start of processing for Is_Potentially_Unevaluated
begin
Expr := N;
- Par := N;
-
- -- A postcondition whose expression is a short-circuit is broken down
- -- into individual aspects for better exception reporting. The original
- -- short-circuit expression is rewritten as the second operand, and an
- -- occurrence of 'Old in that operand is potentially unevaluated.
- -- See sem_ch13.adb for details of this transformation. The reference
- -- to 'Old may appear within an expression, so we must look for the
- -- enclosing pragma argument in the tree that contains the reference.
-
- while Present (Par)
- and then Nkind (Par) /= N_Pragma_Argument_Association
- loop
- if Is_Rewrite_Substitution (Par)
- and then Nkind (Original_Node (Par)) = N_And_Then
- then
- return True;
- end if;
-
- Par := Parent (Par);
- end loop;
-
- -- Other cases; 'Old appears within other expression (not the top-level
- -- conjunct in a postcondition) with a potentially unevaluated operand.
-
- Par := Parent (Expr);
+ Par := Parent (Expr);
while Present (Par)
and then Nkind (Par) /= N_Pragma_Argument_Association
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-05-13 8:38 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-13 8:38 [gcc r15-423] ada: Remove code that expected pre/post being split into conjuncts 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).