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>
This commit is contained in:
David Malcolm 2022-07-22 19:50:37 -04:00
parent f77bbc8f86
commit 0fb35a45a2
2 changed files with 8 additions and 1 deletions

View file

@ -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. */

View file

@ -0,0 +1,8 @@
/* { dg-additional-options "-Wno-stringop-overflow" } */
void
main (int c, void *v)
{
static char a[] = "";
__builtin_memcpy (v, a, -1);
}