public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "tlange at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug analyzer/107882] [13 Regression] ICE in get_last_bit_offset, at analyzer/store.h:255 since 13-2582-g0ea5e3f4542832b8
Date: Mon, 28 Nov 2022 19:47:09 +0000	[thread overview]
Message-ID: <bug-107882-4-vXK0XkP7Q0@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-107882-4@http.gcc.gnu.org/bugzilla/>

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.

  parent reply	other threads:[~2022-11-28 19:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-26 19:36 [Bug analyzer/107882] New: [13 Regression] ICE in get_last_bit_offset, at analyzer/store.h:255 asolokha at gmx dot com
2022-11-28  6:49 ` [Bug analyzer/107882] " marxin at gcc dot gnu.org
2022-11-28  7:38 ` [Bug analyzer/107882] [13 Regression] ICE in get_last_bit_offset, at analyzer/store.h:255 since 13-2582-g0ea5e3f4542832b8 rguenth at gcc dot gnu.org
2022-11-28 19:47 ` tlange at gcc dot gnu.org [this message]
2022-12-06 20:53 ` dmalcolm at gcc dot gnu.org
2022-12-06 23:25 ` cvs-commit at gcc dot gnu.org
2022-12-06 23:33 ` dmalcolm at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-107882-4-vXK0XkP7Q0@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).