Explicit NANs in the IL can be treated as undefined for
flag_finite_math_only. This causes all the right things to happen wrt
threading, folding, etc. It also saves us special casing throughout.
PR tree-optimization/106967
gcc/ChangeLog:
* value-range.cc (frange::set): Set known NANs to undefined for
flag_finite_math_only.
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;
}