From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id B1B543858405 for ; Fri, 22 Jul 2022 23:54:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B1B543858405 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-561-xpSndqutPOWidfIfV1RX8w-1; Fri, 22 Jul 2022 19:54:38 -0400 X-MC-Unique: xpSndqutPOWidfIfV1RX8w-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0AF72811E75 for ; Fri, 22 Jul 2022 23:54:38 +0000 (UTC) Received: from t14s.localdomain.com (unknown [10.2.16.236]) by smtp.corp.redhat.com (Postfix) with ESMTP id D7B22404754B; Fri, 22 Jul 2022 23:54:37 +0000 (UTC) From: David Malcolm To: gcc-patches@gcc.gnu.org Subject: [committed] analyzer: fix ICE in binding_cluster ctor [PR106401] Date: Fri, 22 Jul 2022 19:54:36 -0400 Message-Id: <20220722235436.1705578-1-dmalcolm@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jul 2022 23:54:40 -0000 Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r13-1806-g0fb35a45a28c67. 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 --- gcc/analyzer/store.cc | 1 - gcc/testsuite/gcc.dg/analyzer/memcpy-2.c | 8 ++++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.dg/analyzer/memcpy-2.c 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); +} -- 2.26.3