aboutsummaryrefslogtreecommitdiff
path: root/gcc/real.h
diff options
context:
space:
mode:
authorAldy Hernandez <aldyh@redhat.com>2022-10-14 12:08:11 +0200
committerAldy Hernandez <aldyh@redhat.com>2022-10-14 16:38:40 +0200
commit3dfeda095bd43c011fdc3834b9cec39bb9a73a1f (patch)
tree6cac9c74cbf2711e1dffca131fa400c3770e6dbe /gcc/real.h
parent0dd9dd1fdfca1219bbe3ac460b50c6776b427119 (diff)
downloadgcc-3dfeda095bd43c011fdc3834b9cec39bb9a73a1f.zip
gcc-3dfeda095bd43c011fdc3834b9cec39bb9a73a1f.tar.gz
gcc-3dfeda095bd43c011fdc3834b9cec39bb9a73a1f.tar.bz2
Check rvc_normal in real_isdenormal.
[-Inf, -Inf] is being flushed to [-Inf, -0.0] because real_isdenormal is being overly pessimistic. It is missing a check for rvc_normal. This doesn't cause problems in real.cc because all uses of real_isdenormal are already on the rvc_normal path. The uses in value-range.cc however, are not. This patch adds a check for rvc_normal. gcc/ChangeLog: * real.h (real_isdenormal): Check rvc_normal. * value-range.cc (range_tests_floats): New test.
Diffstat (limited to 'gcc/real.h')
-rw-r--r--gcc/real.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/real.h b/gcc/real.h
index f9528d7..306e959 100644
--- a/gcc/real.h
+++ b/gcc/real.h
@@ -290,7 +290,7 @@ extern bool real_issignaling_nan (const REAL_VALUE_TYPE *);
inline bool
real_isdenormal (const REAL_VALUE_TYPE *r)
{
- return (r->sig[SIGSZ-1] & SIG_MSB) == 0;
+ return r->cl == rvc_normal && (r->sig[SIGSZ-1] & SIG_MSB) == 0;
}
/* Determine whether a floating-point value X is finite. */