Commit e87deb37 by David Malcolm

analyzer: handle vector types (PR 93350)

gcc/analyzer/ChangeLog:
	PR analyzer/93350
	* region-model.cc (region_model::get_lvalue_1):
	Handle BIT_FIELD_REF.
	(make_region_for_type): Handle VECTOR_TYPE.

gcc/testsuite/ChangeLog:
	PR analyzer/93350
	* gcc.dg/analyzer/torture/pr93350.c: New test.
parent e953f958
2020-02-10 David Malcolm <dmalcolm@redhat.com> 2020-02-10 David Malcolm <dmalcolm@redhat.com>
PR analyzer/93350
* region-model.cc (region_model::get_lvalue_1):
Handle BIT_FIELD_REF.
(make_region_for_type): Handle VECTOR_TYPE.
2020-02-10 David Malcolm <dmalcolm@redhat.com>
PR analyzer/93647 PR analyzer/93647
* diagnostic-manager.cc * diagnostic-manager.cc
(diagnostic_manager::prune_for_sm_diagnostic): Bulletproof against (diagnostic_manager::prune_for_sm_diagnostic): Bulletproof against
......
...@@ -4635,6 +4635,14 @@ region_model::get_lvalue_1 (path_var pv, region_model_context *ctxt) ...@@ -4635,6 +4635,14 @@ region_model::get_lvalue_1 (path_var pv, region_model_context *ctxt)
} }
break; break;
case BIT_FIELD_REF:
{
/* For now, create a view, as if a cast, ignoring the bit positions. */
tree obj = TREE_OPERAND (expr, 0);
return get_or_create_view (get_lvalue (obj, ctxt), TREE_TYPE (expr));
};
break;
case MEM_REF: case MEM_REF:
{ {
tree ptr = TREE_OPERAND (expr, 0); tree ptr = TREE_OPERAND (expr, 0);
...@@ -6008,7 +6016,8 @@ make_region_for_type (region_id parent_rid, tree type) ...@@ -6008,7 +6016,8 @@ make_region_for_type (region_id parent_rid, tree type)
if (INTEGRAL_TYPE_P (type) if (INTEGRAL_TYPE_P (type)
|| SCALAR_FLOAT_TYPE_P (type) || SCALAR_FLOAT_TYPE_P (type)
|| POINTER_TYPE_P (type) || POINTER_TYPE_P (type)
|| TREE_CODE (type) == COMPLEX_TYPE) || TREE_CODE (type) == COMPLEX_TYPE
|| TREE_CODE (type) == VECTOR_TYPE)
return new primitive_region (parent_rid, type); return new primitive_region (parent_rid, type);
if (TREE_CODE (type) == RECORD_TYPE) if (TREE_CODE (type) == RECORD_TYPE)
......
2020-02-10 David Malcolm <dmalcolm@redhat.com> 2020-02-10 David Malcolm <dmalcolm@redhat.com>
PR analyzer/93350
* gcc.dg/analyzer/torture/pr93350.c: New test.
2020-02-10 David Malcolm <dmalcolm@redhat.com>
PR analyzer/93647 PR analyzer/93647
* gcc.dg/analyzer/torture/pr93647.c: New test. * gcc.dg/analyzer/torture/pr93647.c: New test.
......
/* { dg-require-effective-target vect_int } */
/* { dg-additional-options "-Wno-psabi" } */
typedef __INT32_TYPE__ int32_t;
typedef int32_t vnx4si __attribute__((vector_size (32)));
__attribute__((noipa))
vnx4si foo(int a, int b)
{
return (vnx4si) { 1, 2, 3, 4, 5, 6, a, b };
}
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