summaryrefslogtreecommitdiff
path: root/gcc/ada/exp_fixd.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-17 13:06:08 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-17 13:06:08 +0000
commitbd4b644b8fa7d902ab5624f52dc15c36a5634722 (patch)
treeff9ab42a6cce0408f4d6bdb3de7d882c283b34a3 /gcc/ada/exp_fixd.adb
parent912886f257acf338e81ebb40b535fd95cace44a0 (diff)
downloadgcc-bd4b644b8fa7d902ab5624f52dc15c36a5634722.tar.gz
2009-04-17 Pascal Obry <obry@adacore.com>
* initialize.c: Fix test for reallocating the arguments array. 2009-04-17 Geert Bosch <bosch@adacore.com> * exp_fixd.adb (Expand_Convert_Float_To_Fixed): Have float to fixed conversion truncate only for decimal fixed point types. 2009-04-17 Jerome Lambourg <lambourg@adacore.com> * g-comlin.adb (Initialize_Scan_Option): Make sure the sections are reinitialized. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146261 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/exp_fixd.adb')
-rw-r--r--gcc/ada/exp_fixd.adb4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/ada/exp_fixd.adb b/gcc/ada/exp_fixd.adb
index afac7b0b298..fa878c2bf78 100644
--- a/gcc/ada/exp_fixd.adb
+++ b/gcc/ada/exp_fixd.adb
@@ -1701,13 +1701,15 @@ package body Exp_Fixd is
Set_Result (N, Expr, Rng_Check, Trunc => True);
-- Normal case where multiply is required
+ -- Rounding is truncating for decimal fixed point types only,
+ -- see RM 4.6(29).
else
Set_Result (N,
Build_Multiply (N,
Fpt_Value (Expr),
Real_Literal (N, Ureal_1 / Small)),
- Rng_Check, Trunc => True);
+ Rng_Check, Trunc => Is_Decimal_Fixed_Point_Type (Result_Type));
end if;
end Expand_Convert_Float_To_Fixed;