diff options
author | David Malcolm <dmalcolm@redhat.com> | 2021-12-06 14:04:35 -0500 |
---|---|---|
committer | David Malcolm <dmalcolm@redhat.com> | 2021-12-06 18:36:33 -0500 |
commit | c9543403c19fdc3c3b5a8db8546340de085bd14e (patch) | |
tree | b6ab4e9e0cec37beb184a27c2df3b38a485e865c /libgo | |
parent | 325c6163a33af91264d1b7817a45b8425d5e6a4f (diff) | |
download | gcc-c9543403c19fdc3c3b5a8db8546340de085bd14e.zip gcc-c9543403c19fdc3c3b5a8db8546340de085bd14e.tar.gz gcc-c9543403c19fdc3c3b5a8db8546340de085bd14e.tar.bz2 |
analyzer: fix equivalence class state purging [PR103533]
Whilst debugging state explosions seen when enabling taint detection
with -fanalyzer (PR analyzer/103533), I noticed that constraint
manager instances could contain stray, redundant constants, such
as this instance:
constraint_manager:
equiv classes:
ec0: {(int)0 == [m_constant]‘0’}
ec1: {(size_t)4 == [m_constant]‘4’}
constraints:
where there are two equivalence classes, each just containing a
constant, with no constraints using them.
This patch makes constraint_manager::canonicalize more aggressive
about purging state, handling the case of purging a redundant
EC containing just a constant.
gcc/analyzer/ChangeLog:
PR analyzer/103533
* constraint-manager.cc (equiv_class::contains_non_constant_p):
New.
(constraint_manager::canonicalize): Call it when determining
redundant ECs.
(selftest::test_purging): New selftest.
(selftest::run_constraint_manager_tests): Likewise.
* constraint-manager.h (equiv_class::contains_non_constant_p):
New decl.
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
Diffstat (limited to 'libgo')
0 files changed, 0 insertions, 0 deletions