aboutsummaryrefslogtreecommitdiff
path: root/gcc/real.c
diff options
context:
space:
mode:
authorRoger Sayle <roger@eyesopen.com>2005-01-20 21:53:31 +0000
committerRoger Sayle <sayle@gcc.gnu.org>2005-01-20 21:53:31 +0000
commit8ffeac67a786b8ccce5541f82c135de211412b67 (patch)
tree82bf6bb0301d879a5d56200bb826c83f83c9f256 /gcc/real.c
parent07ff6dacabb8964e3344e1eccdd5cc59ea543b88 (diff)
downloadgcc-8ffeac67a786b8ccce5541f82c135de211412b67.zip
gcc-8ffeac67a786b8ccce5541f82c135de211412b67.tar.gz
gcc-8ffeac67a786b8ccce5541f82c135de211412b67.tar.bz2
real.c (real_floor): Don't leave the result uninitialized when mode is VOIDMode...
* real.c (real_floor): Don't leave the result uninitialized when mode is VOIDMode, but return the unrounded intermediate value. (real_ceil): Likewise. From-SVN: r93988
Diffstat (limited to 'gcc/real.c')
-rw-r--r--gcc/real.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/real.c b/gcc/real.c
index ebd402a..5871d1e 100644
--- a/gcc/real.c
+++ b/gcc/real.c
@@ -1,6 +1,6 @@
/* real.c - software floating point emulation.
Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2002, 2003, 2004 Free Software Foundation, Inc.
+ 2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
Contributed by Stephen L. Moshier (moshier@world.std.com).
Re-written by Richard Henderson <rth@redhat.com>
@@ -4625,6 +4625,8 @@ real_floor (REAL_VALUE_TYPE *r, enum machine_mode mode,
do_add (&t, &t, &dconstm1, 0);
if (mode != VOIDmode)
real_convert (r, mode, &t);
+ else
+ *r = t;
}
/* Round X to the smallest integer not less then argument, i.e. round
@@ -4641,6 +4643,8 @@ real_ceil (REAL_VALUE_TYPE *r, enum machine_mode mode,
do_add (&t, &t, &dconst1, 0);
if (mode != VOIDmode)
real_convert (r, mode, &t);
+ else
+ *r = t;
}
/* Round X to the nearest integer, but round halfway cases away from