https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125298

David Malcolm <dmalcolm at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |amacleod at redhat dot com

--- Comment #4 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
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)

Reply via email to