aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2020-08-24 18:07:45 +0200
committerPierre-Marie de Rodat <derodat@adacore.com>2020-10-22 08:11:25 -0400
commitd7a6aa4969869138117312ec48a2b995f8252793 (patch)
tree2368f94b4d8fb1130faa926a72069ca4737a0108 /gcc
parentdaaf017932882f96a6572622766c2975dcc93819 (diff)
downloadgcc-d7a6aa4969869138117312ec48a2b995f8252793.zip
gcc-d7a6aa4969869138117312ec48a2b995f8252793.tar.gz
gcc-d7a6aa4969869138117312ec48a2b995f8252793.tar.bz2
[Ada] Get rid of useless if-then-else in Exp_Fixd.Fpt_Value
gcc/ada/ * exp_fixd.adb (Fpt_Value): Fold if-then-else with identical arms.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/exp_fixd.adb15
1 files changed, 2 insertions, 13 deletions
diff --git a/gcc/ada/exp_fixd.adb b/gcc/ada/exp_fixd.adb
index 1cb0188..42cf626 100644
--- a/gcc/ada/exp_fixd.adb
+++ b/gcc/ada/exp_fixd.adb
@@ -186,7 +186,7 @@ package body Exp_Fixd is
-- Given an operand of fixed-point operation, return an expression that
-- represents the corresponding Universal_Real value. The expression
-- can be of integer type, floating-point type, or fixed-point type.
- -- The expression returned is neither analyzed and resolved. The Etype
+ -- The expression returned is neither analyzed nor resolved. The Etype
-- of the result is properly set (to Universal_Real).
function Integer_Literal
@@ -2351,19 +2351,8 @@ package body Exp_Fixd is
---------------
function Fpt_Value (N : Node_Id) return Node_Id is
- Typ : constant Entity_Id := Etype (N);
-
begin
- if Is_Integer_Type (Typ)
- or else Is_Floating_Point_Type (Typ)
- then
- return Build_Conversion (N, Universal_Real, N);
-
- -- Fixed-point case, must get integer value first
-
- else
- return Build_Conversion (N, Universal_Real, N);
- end if;
+ return Build_Conversion (N, Universal_Real, N);
end Fpt_Value;
---------------------