aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2024-09-26 08:40:28 +0200
committerMarc Poulhiès <dkm@gcc.gnu.org>2024-11-04 16:57:54 +0100
commitc9328cb4b106a6b9afe3359e0287ece496b8e277 (patch)
tree7c7340f3dd45845d7c4c7ef7eb4c112c3225ef1a
parent1c46a541c6957e8b0eee339d4cff46e951a5ad4e (diff)
downloadgcc-c9328cb4b106a6b9afe3359e0287ece496b8e277.zip
gcc-c9328cb4b106a6b9afe3359e0287ece496b8e277.tar.gz
gcc-c9328cb4b106a6b9afe3359e0287ece496b8e277.tar.bz2
ada: Fix asymmetry in resolution of unary intrinsic operators
Resolution of binary and unary intrinsic operators differed when expansion was inactive. In particular, this affected GNATprove handling of Ada.Real_Time."abs" operator. This patch makes unary resolution behave like binary resolution. gcc/ada/ChangeLog: * sem_res.adb (Resolve_Intrinsic_Unary_Operator): Disable when expansion is inactive.
-rw-r--r--gcc/ada/sem_res.adb7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index 6a2680b..0abdeee 100644
--- a/gcc/ada/sem_res.adb
+++ b/gcc/ada/sem_res.adb
@@ -9972,6 +9972,13 @@ package body Sem_Res is
Arg2 : Node_Id;
begin
+ -- We must preserve the original entity in a generic setting, so that
+ -- the legality of the operation can be verified in an instance.
+
+ if not Expander_Active then
+ return;
+ end if;
+
Op := Entity (N);
while Scope (Op) /= Standard_Standard loop
Op := Homonym (Op);