aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2024-09-27 17:53:29 +0200
committerMarc Poulhiès <dkm@gcc.gnu.org>2024-11-04 16:57:55 +0100
commitd797d051aabdd7beb38935b4610cc44f94c18aea (patch)
tree4b927ce7ee84a0fdfabb167929976744acddbc18
parent625c4ec2b3d3a59138a0a00178307ecba916aeea (diff)
downloadgcc-d797d051aabdd7beb38935b4610cc44f94c18aea.zip
gcc-d797d051aabdd7beb38935b4610cc44f94c18aea.tar.gz
gcc-d797d051aabdd7beb38935b4610cc44f94c18aea.tar.bz2
ada: Avoid run-time conversion of 0 from Int to Uint
Code cleanup and tiny performance improvement; semantics is unaffected. gcc/ada/ChangeLog: * exp_ch4.adb (Expand_N_Op_Subtract): Replace numeric literal with universal integer constant, just like it is done in expansion of addition operator.
-rw-r--r--gcc/ada/exp_ch4.adb2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb
index 9024c1a..b2cc672 100644
--- a/gcc/ada/exp_ch4.adb
+++ b/gcc/ada/exp_ch4.adb
@@ -10031,7 +10031,7 @@ package body Exp_Ch4 is
if Is_Integer_Type (Typ)
and then Compile_Time_Known_Value (Right_Opnd (N))
- and then Expr_Value (Right_Opnd (N)) = 0
+ and then Expr_Value (Right_Opnd (N)) = Uint_0
then
Rewrite (N, Left_Opnd (N));
return;