aboutsummaryrefslogtreecommitdiff
path: root/gcc/value-range.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/value-range.cc')
-rw-r--r--gcc/value-range.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/value-range.cc b/gcc/value-range.cc
index 55a216e..67d5d7f 100644
--- a/gcc/value-range.cc
+++ b/gcc/value-range.cc
@@ -639,6 +639,21 @@ frange::singleton_p (tree *result) const
if (HONOR_NANS (m_type) && maybe_isnan ())
return false;
+ if (MODE_COMPOSITE_P (TYPE_MODE (m_type)))
+ {
+ // For IBM long doubles, if the value is +-Inf or is exactly
+ // representable in double, the other double could be +0.0
+ // or -0.0. Since this means there is more than one way to
+ // represent a value, return false to avoid propagating it.
+ // See libgcc/config/rs6000/ibm-ldouble-format for details.
+ if (real_isinf (&m_min))
+ return false;
+ REAL_VALUE_TYPE r;
+ real_convert (&r, DFmode, &m_min);
+ if (real_identical (&r, &m_min))
+ return false;
+ }
+
if (result)
*result = build_real (m_type, m_min);
return true;