gcc/analyzer/ChangeLog:
PR analyzer/93647
* diagnostic-manager.cc
(diagnostic_manager::prune_for_sm_diagnostic): Bulletproof against
VAR being constant.
* region-model.cc (region_model::get_lvalue_1): Provide a better
error message when encountering an unhandled tree code.
gcc/testsuite/ChangeLog:
PR analyzer/93647
* gcc.dg/analyzer/torture/pr93647.c: New test.
+2020-02-10 David Malcolm <dmalcolm@redhat.com>
+
+ PR analyzer/93647
+ * diagnostic-manager.cc
+ (diagnostic_manager::prune_for_sm_diagnostic): Bulletproof against
+ VAR being constant.
+ * region-model.cc (region_model::get_lvalue_1): Provide a better
+ error message when encountering an unhandled tree code.
+
2020-02-10 David Malcolm <dmalcolm@redhat.com>
PR analyzer/93405
tree var,
state_machine::state_t state) const
{
+ /* If we have a constant (such as NULL), assume its state is also
+ constant, so as not to attempt to get its lvalue whilst tracking the
+ origin of the state. */
+ if (var && CONSTANT_CLASS_P (var))
+ var = NULL_TREE;
+
int idx = path->num_events () - 1;
while (idx >= 0 && idx < (signed)path->num_events ())
{
switch (TREE_CODE (expr))
{
default:
+ internal_error ("unhandled tree code in region_model::get_lvalue_1: %qs",
+ get_tree_code_name (TREE_CODE (expr)));
gcc_unreachable ();
case ARRAY_REF:
+2020-02-10 David Malcolm <dmalcolm@redhat.com>
+
+ PR analyzer/93647
+ * gcc.dg/analyzer/torture/pr93647.c: New test.
+
2020-02-10 Jakub Jelinek <jakub@redhat.com>
PR target/93637
--- /dev/null
+/* { dg-skip-if "" { *-*-* } { "-fno-fat-lto-objects" } { "" } } */
+
+int *tz;
+
+void
+ky (int);
+
+void
+wd (void)
+{
+ tz = 0;
+ ky (*tz); /* { dg-warning "dereference of NULL" } */
+}
+