analyzer: skip constant pool in -fdump-analyzer-untracked [PR testsuite/105085]
authorDavid Malcolm <dmalcolm@redhat.com>
Tue, 29 Mar 2022 21:50:48 +0000 (17:50 -0400)
committerDavid Malcolm <dmalcolm@redhat.com>
Tue, 29 Mar 2022 21:50:48 +0000 (17:50 -0400)
commitc788a0eae0a7144e6f148162512fa2e93a45a035
tree30d7ee6b2c47d78b611feadc45090ce9eb991fb4
parent69db6e7f4e1d07bf8f33e93a29139cc16c1e0a2f
analyzer: skip constant pool in -fdump-analyzer-untracked [PR testsuite/105085]

In r12-7809-g5f6197d7c197f9 I added -fdump-analyzer-untracked as support
for DejaGnu testing of an optimization of -fanalyzer,
PR analyzer/104954.

PR testsuite/105085 notes testsuite failures of the form:
  FAIL: gcc.dg/analyzer/untracked-1.c (test for excess errors)
  Excess errors:
  cc1: warning: track '*.LC1': yes
where these warnings are emitted on some targets where the test
causes labelled constants to be created in the constant pool.

We probably ought not to be tracking the values of such decls in the
store, given that they're meant to be constant, and I attempted various
fixes to make the "should we track this decl" logic smarter, but given
that we're in stage 4, the simplest fix seems to be for
-fdump-analyzer-untracked to skip such decls in its output, to minimize
test output differences between targets.

gcc/analyzer/ChangeLog:
PR testsuite/105085
* region-model-manager.cc (dump_untracked_region): Skip decls in
the constant pool.

gcc/testsuite/ChangeLog:
PR testsuite/105085
* gcc.dg/analyzer/untracked-1.c: Add further test coverage.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
gcc/analyzer/region-model-manager.cc
gcc/testsuite/gcc.dg/analyzer/untracked-1.c