aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Schonberg <schonberg@adacore.com>2006-10-31 18:56:09 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2006-10-31 18:56:09 +0100
commit20f96ac9188ba6c00a1afd0e912ca1910160fbaf (patch)
treed6a300c93a56d25c47d76307593b568f9dfd7f26
parent92869a7b6b8dc3ad4c0e0a299ec36906c2090c8c (diff)
downloadgcc-20f96ac9188ba6c00a1afd0e912ca1910160fbaf.zip
gcc-20f96ac9188ba6c00a1afd0e912ca1910160fbaf.tar.gz
gcc-20f96ac9188ba6c00a1afd0e912ca1910160fbaf.tar.bz2
exp_fixd.adb (Rounded_Result_Set): For multiplication and division of fixed-point operations in an integer context...
2006-10-31 Ed Schonberg <schonberg@adacore.com> * exp_fixd.adb (Rounded_Result_Set): For multiplication and division of fixed-point operations in an integer context, i.e. as operands of a conversion to an integer type, indicate that result must be rounded. From-SVN: r118265
-rw-r--r--gcc/ada/exp_fixd.adb7
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/ada/exp_fixd.adb b/gcc/ada/exp_fixd.adb
index fa1f840..b82d3ad 100644
--- a/gcc/ada/exp_fixd.adb
+++ b/gcc/ada/exp_fixd.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2005, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2006, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -198,7 +198,7 @@ package body Exp_Fixd is
function Rounded_Result_Set (N : Node_Id) return Boolean;
-- Returns True if N is a node that contains the Rounded_Result flag
- -- and if the flag is true.
+ -- and if the flag is true or the target type is an integer type.
procedure Set_Result (N : Node_Id; Expr : Node_Id; Rchk : Boolean := False);
-- N is the node for the current conversion, division or multiplication
@@ -2329,7 +2329,8 @@ package body Exp_Fixd is
if (K = N_Type_Conversion or else
K = N_Op_Divide or else
K = N_Op_Multiply)
- and then Rounded_Result (N)
+ and then
+ (Rounded_Result (N) or else Is_Integer_Type (Etype (N)))
then
return True;
else