aboutsummaryrefslogtreecommitdiff
path: root/gcc/real.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/real.c')
-rw-r--r--gcc/real.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/real.c b/gcc/real.c
index c4b6479..1e1083f 100644
--- a/gcc/real.c
+++ b/gcc/real.c
@@ -1862,6 +1862,11 @@ real_from_string (REAL_VALUE_TYPE *r, const char *str)
str++;
}
}
+
+ /* If the mantissa is zero, ignore the exponent. */
+ if (!cmp_significand_0 (r))
+ goto underflow;
+
if (*str == 'p' || *str == 'P')
{
bool exp_neg = false;
@@ -1934,6 +1939,10 @@ real_from_string (REAL_VALUE_TYPE *r, const char *str)
}
}
+ /* If the mantissa is zero, ignore the exponent. */
+ if (r->cl == rvc_zero)
+ goto underflow;
+
if (*str == 'e' || *str == 'E')
{
bool exp_neg = false;