https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125298
Andrew Macleod <amacleod at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |aldyh at gcc dot gnu.org,
| |jakub at gcc dot gnu.org
--- Comment #5 from Andrew Macleod <amacleod at redhat dot com> ---
(In reply to David Malcolm from comment #4)
> It's an assertion failure in here:
>
> #1 0x0000000002c45580 in frange::set (this=0x7fffffffbf48, type=<real_type
> 0x7fffe9625348 double>,
> min=..., max=..., nan=..., kind=VR_RANGE) at
> ../../src/gcc/value-range.cc:1192
> 1192 gcc_checking_assert (!real_isnan (&min) && !real_isnan (&max));
>
> due to:
>
> 1025 constant_svalue::maybe_get_value_range_1 (value_range &out) const
> 1026 {
> 1027 if (!type_can_have_value_range_p (get_type ()))
> 1028 return false;
> 1029
> 1030 out = value_range (m_cst_expr, m_cst_expr);
> 1031 return true;
> 1032 }
>
> which has:
>
> 954 inline
> 955 value_range::value_range (tree min, tree max, value_range_kind kind)
> 956 {
> 957 init (TREE_TYPE (min));
> 958 m_vrange->set (min, max, kind);
> 959 }
>
> when m_cst_expr is a NaN. Presumably for this case we want a VR_NAN.
>
> Andrew, is there a way to set a value_range to be a singleton from a tree
> cst? (rather than setting it to a min/max range where both min == max ==
> the tree cst, as the analyzer is constant_svalue::maybe_get_value_range_1 is
> currently doing)
no, but this seems more like a bug in frange::set()... seems like if min or
max is a NaN, then it ought to verify they both are and then call the
approriate set_nan. guess that kind of call has not happened yet! first!