Message ID | 20220921113039.2173181-1-aldyh@redhat.com |
---|---|
State | New |
Headers | show |
Series | [COMMITTED,PR106967] Set known NANs to undefined for flag_finite_math_only. | expand |
diff --git a/gcc/value-range.cc b/gcc/value-range.cc index 505eb9211a7..7e8028eced2 100644 --- a/gcc/value-range.cc +++ b/gcc/value-range.cc @@ -313,8 +313,13 @@ frange::set (tree min, tree max, value_range_kind kind) gcc_checking_assert (real_identical (TREE_REAL_CST_PTR (min), TREE_REAL_CST_PTR (max))); tree type = TREE_TYPE (min); - bool sign = real_isneg (TREE_REAL_CST_PTR (min)); - set_nan (type, sign); + if (HONOR_NANS (type)) + { + bool sign = real_isneg (TREE_REAL_CST_PTR (min)); + set_nan (type, sign); + } + else + set_undefined (); return; }