public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: David Malcolm <dmalcolm@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r13-1806] analyzer: fix ICE in binding_cluster ctor [PR106401]
Date: Fri, 22 Jul 2022 23:52:53 +0000 (GMT)	[thread overview]
Message-ID: <20220722235253.2F6A03858295@sourceware.org> (raw)

https://gcc.gnu.org/g:0fb35a45a28c674d5d420528f7dec629e42b4850

commit r13-1806-g0fb35a45a28c674d5d420528f7dec629e42b4850
Author: David Malcolm <dmalcolm@redhat.com>
Date:   Fri Jul 22 19:50:37 2022 -0400

    analyzer: fix ICE in binding_cluster ctor [PR106401]
    
    gcc/analyzer/ChangeLog:
            PR analyzer/106401
            * store.cc (binding_cluster::binding_cluster): Remove overzealous
            assertion; we're checking for tracked_p in
            store::get_or_create_cluster.
    
    gcc/testsuite/ChangeLog:
            PR analyzer/106401
            * gcc.dg/analyzer/memcpy-2.c: New test.
    
    Signed-off-by: David Malcolm <dmalcolm@redhat.com>

Diff:
---
 gcc/analyzer/store.cc                    | 1 -
 gcc/testsuite/gcc.dg/analyzer/memcpy-2.c | 8 ++++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/gcc/analyzer/store.cc b/gcc/analyzer/store.cc
index e3dabf300df..0b3fb370d1e 100644
--- a/gcc/analyzer/store.cc
+++ b/gcc/analyzer/store.cc
@@ -1107,7 +1107,6 @@ binding_cluster::binding_cluster (const region *base_region)
 : m_base_region (base_region), m_map (),
   m_escaped (false), m_touched (false)
 {
-  gcc_assert (base_region->tracked_p ());
 }
 
 /* binding_cluster's copy ctor.  */
diff --git a/gcc/testsuite/gcc.dg/analyzer/memcpy-2.c b/gcc/testsuite/gcc.dg/analyzer/memcpy-2.c
new file mode 100644
index 00000000000..88ec84cb640
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/memcpy-2.c
@@ -0,0 +1,8 @@
+/* { dg-additional-options "-Wno-stringop-overflow" } */
+
+void
+main (int c, void *v)
+{
+  static char a[] = "";
+  __builtin_memcpy (v, a, -1);
+}


                 reply	other threads:[~2022-07-22 23:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20220722235253.2F6A03858295@sourceware.org \
    --to=dmalcolm@gcc.gnu.org \
    --cc=gcc-cvs@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).