+2020-01-31 David Malcolm <dmalcolm@redhat.com>
+
+ PR analyzer/93373
+ * region-model.cc (ASSERT_COMPAT_TYPES): Convert to...
+ (assert_compat_types): ...this, and bail when either type is NULL,
+ or when VOID_TYPE_P (dst_type).
+ (region_model::get_lvalue): Update for above conversion.
+ (region_model::get_rvalue): Likewise.
+
2020-01-31 David Malcolm <dmalcolm@redhat.com>
PR analyzer/93379
/* Assert that SRC_TYPE can be converted to DST_TYPE as a no-op. */
-#define ASSERT_COMPAT_TYPES(SRC_TYPE, DST_TYPE) \
- gcc_checking_assert (useless_type_conversion_p ((SRC_TYPE), (DST_TYPE)))
+static void
+assert_compat_types (tree src_type, tree dst_type)
+{
+ if (src_type && dst_type && !VOID_TYPE_P (dst_type))
+ gcc_checking_assert (useless_type_conversion_p (src_type, dst_type));
+}
/* Get the id of the region for PV within this region_model,
emitting any diagnostics to CTXT. */
return region_id::null ();
region_id result_rid = get_lvalue_1 (pv, ctxt);
- ASSERT_COMPAT_TYPES (get_region (result_rid)->get_type (),
+ assert_compat_types (get_region (result_rid)->get_type (),
TREE_TYPE (pv.m_tree));
return result_rid;
}
return svalue_id::null ();
svalue_id result_sid = get_rvalue_1 (pv, ctxt);
- ASSERT_COMPAT_TYPES (get_svalue (result_sid)->get_type (),
+ assert_compat_types (get_svalue (result_sid)->get_type (),
TREE_TYPE (pv.m_tree));
return result_sid;
+2020-01-31 David Malcolm <dmalcolm@redhat.com>
+
+ PR analyzer/93373
+ * gcc.dg/analyzer/torture/pr93373.c: New test.
+
2020-01-31 Vladimir Makarov <vmakarov@redhat.com>
PR rtl-optimization/91333