analyzer: fix ICE with equiv_class constant (PR 93649)
authorDavid Malcolm <dmalcolm@redhat.com>
Mon, 10 Feb 2020 21:47:21 +0000 (16:47 -0500)
committerDavid Malcolm <dmalcolm@redhat.com>
Tue, 11 Feb 2020 18:32:51 +0000 (13:32 -0500)
commitcd28b75921354c64fd4c8a1c238991e522abc38e
tree42067c26f5d8b61751c50b6b73e10b91fa50deb1
parent5e17c1bdadbbd5606d869b1178ed3e653f931cda
analyzer: fix ICE with equiv_class constant (PR 93649)

gcc/analyzer/ChangeLog:
PR analyzer/93649
* constraint-manager.cc (constraint_manager::add_constraint): When
merging equivalence classes and updating m_constant, also update
m_cst_sid.
(constraint_manager::validate): If m_constant is non-NULL assert
that m_cst_sid is non-null and is valid.

gcc/testsuite/ChangeLog:
PR analyzer/93649
* gcc.dg/analyzer/torture/pr93649.c: New test.
gcc/analyzer/ChangeLog
gcc/analyzer/constraint-manager.cc
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/analyzer/torture/pr93649.c [new file with mode: 0644]