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

--- Comment #5 from Andrew Macleod <amacleod at redhat dot com> ---
It is trapping when asking for the type() of an UNDEFINED range.

Looking up the call chain:
Breakpoint 2, ipcp_store_vr_results () at /gcc/master/gcc/gcc/ipa-cp.cc:6366
6366                      tmp.update_bitmask (bm);

(gdb) p tmp.dump(stderr)
[irange] short int [0, 0] 

so tmp starts with a range of [0,0]

and then an attempt is made to apply a bitmask
(gdb) p bm.dump(stderr)
MASK 0xfffe VALUE 0x1$7 = void

The bitmask that is being set indicates that we KNOW bit 0 is the value 1.

This is incongruent a range of [0,0] and the new code which removes the lower
bit ranges of a specified bitmask says [0,0] is not a value range for this
bitmask, and we end up making tmp UNDEFINED.

 It seems like the bitmask is being incorrectly created for this range?


6358                      value_range tmp = plats->m_value_range.m_vr;
6359                      tree type = ipa_get_type (info, i);
6360                      irange_bitmask bm (wide_int::from (bits->get_value
(),
6361                                                         TYPE_PRECISION
(type),
6362                                                         TYPE_SIGN (type)),
6363                                         wide_int::from (bits->get_mask (),
6364                                                         TYPE_PRECISION
(type),
6365                                                         TYPE_SIGN
(type)));
6366                      tmp.update_bitmask (bm);
6367                      ipa_vr vr (tmp);
6368                      ts->m_vr->quick_push (vr);

Why is it even creating a bitmask?

Reply via email to