Commit 67751724 by David Malcolm

analyzer: fix ICE with 'const void *' (PR 93457)

gcc/analyzer/ChangeLog:
	PR analyzer/93457
	* region-model.cc (make_region_for_type): Use VOID_TYPE_P rather
	than checking against void_type_node.

gcc/testsuite/ChangeLog:
	PR analyzer/93457
	* gcc.dg/analyzer/pr93457.c: New test.
parent 09bea584
2020-01-31 David Malcolm <dmalcolm@redhat.com> 2020-01-31 David Malcolm <dmalcolm@redhat.com>
PR analyzer/93457
* region-model.cc (make_region_for_type): Use VOID_TYPE_P rather
than checking against void_type_node.
2020-01-31 David Malcolm <dmalcolm@redhat.com>
PR analyzer/93373 PR analyzer/93373
* region-model.cc (ASSERT_COMPAT_TYPES): Convert to... * region-model.cc (ASSERT_COMPAT_TYPES): Convert to...
(assert_compat_types): ...this, and bail when either type is NULL, (assert_compat_types): ...this, and bail when either type is NULL,
......
...@@ -6005,7 +6005,7 @@ make_region_for_type (region_id parent_rid, tree type) ...@@ -6005,7 +6005,7 @@ make_region_for_type (region_id parent_rid, tree type)
return new function_region (parent_rid, type); return new function_region (parent_rid, type);
/* If we have a void *, make a new symbolic region. */ /* If we have a void *, make a new symbolic region. */
if (type == void_type_node) if (VOID_TYPE_P (type))
return new symbolic_region (parent_rid, false); return new symbolic_region (parent_rid, false);
gcc_unreachable (); gcc_unreachable ();
......
2020-01-31 David Malcolm <dmalcolm@redhat.com> 2020-01-31 David Malcolm <dmalcolm@redhat.com>
PR analyzer/93457
* gcc.dg/analyzer/pr93457.c: New test.
2020-01-31 David Malcolm <dmalcolm@redhat.com>
PR analyzer/93373 PR analyzer/93373
* gcc.dg/analyzer/torture/pr93373.c: New test. * gcc.dg/analyzer/torture/pr93373.c: New test.
......
/* { dg-do compile } */
void
p5 (const void *);
void
s5 (const void *cl)
{
p5 (&cl[1]); /* { dg-warning "dereferencing 'void \\*' pointer" } */
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment