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

--- Comment #2 from Tim Lange <tlange at gcc dot gnu.org> ---
Created attachment 53979
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53979&action=edit
patch for pr107882

I think the assertion here uncovered a bug. Currently, if the OTHER parameter
of bit_range::contains_p is empty (i.e. of size zero), contains_p calls
get_last_bit_offset, which result is only defined for non-empty ranges. Before
r13-2582-g0ea5e3f4542832b8, the contains_p check was inconsistent, e.g. for
(offset 1, size 1) and (offset 1, size 0), but true for (offset 0, size 2) and
(offset 1, size 0).

Not sure what the "right" fix is, as empty ranges sorta feel unnatural.
Treating [i, 0] as a subset of (k, n) if k <= i <= k+n seems somewhat
reasonable.

Reply via email to