summaryrefslogtreecommitdiff
path: root/gcc/real.c
diff options
context:
space:
mode:
authoramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>2005-01-25 20:21:59 +0000
committeramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>2005-01-25 20:21:59 +0000
commit6f803832fcedc39b36df6a4345c34bd7eb689db2 (patch)
tree29cbc4a32fadcdf92681833766a2c7e0753d696a /gcc/real.c
parent04f73f4705d56726b1e34704a035670552898c24 (diff)
downloadgcc-6f803832fcedc39b36df6a4345c34bd7eb689db2.tar.gz
* real.c (do_add): Initialize signalling and canonical members.
* real.c (real_from_integer): Zero out destination. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@94228 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/real.c')
-rw-r--r--gcc/real.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/real.c b/gcc/real.c
index a748b87b33a..7aceb3df038 100644
--- a/gcc/real.c
+++ b/gcc/real.c
@@ -640,6 +640,9 @@ do_add (REAL_VALUE_TYPE *r, const REAL_VALUE_TYPE *a,
r->cl = rvc_normal;
r->sign = sign;
SET_REAL_EXP (r, exp);
+ /* Zero out the remaining fields. */
+ r->signalling = 0;
+ r->canonical = 0;
/* Re-normalize the result. */
normalize (r);
@@ -1957,6 +1960,7 @@ real_from_integer (REAL_VALUE_TYPE *r, enum machine_mode mode,
get_zero (r, 0);
else
{
+ memset (r, 0, sizeof (*r));
r->cl = rvc_normal;
r->sign = high < 0 && !unsigned_p;
SET_REAL_EXP (r, 2 * HOST_BITS_PER_WIDE_INT);
@@ -1974,7 +1978,6 @@ real_from_integer (REAL_VALUE_TYPE *r, enum machine_mode mode,
{
r->sig[SIGSZ-1] = high;
r->sig[SIGSZ-2] = low;
- memset (r->sig, 0, sizeof(long)*(SIGSZ-2));
}
else
{
@@ -1983,8 +1986,6 @@ real_from_integer (REAL_VALUE_TYPE *r, enum machine_mode mode,
r->sig[SIGSZ-2] = high;
r->sig[SIGSZ-3] = low >> (HOST_BITS_PER_LONG - 1) >> 1;
r->sig[SIGSZ-4] = low;
- if (SIGSZ > 4)
- memset (r->sig, 0, sizeof(long)*(SIGSZ-4));
}
normalize (r);