aboutsummaryrefslogtreecommitdiff
path: root/gcc/real.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/real.c')
-rw-r--r--gcc/real.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/real.c b/gcc/real.c
index 9099f41..045a803 100644
--- a/gcc/real.c
+++ b/gcc/real.c
@@ -1789,6 +1789,10 @@ real_from_string (REAL_VALUE_TYPE *r, const char *str)
|= (unsigned long) d << (pos % HOST_BITS_PER_LONG);
pos -= 4;
}
+ else if (d)
+ /* Ensure correct rounding by setting last bit if there is
+ a subsequent nonzero digit. */
+ r->sig[0] |= 1;
exp += 4;
str++;
}