aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-dse.c
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2021-04-05 10:48:01 -0400
committerDavid Malcolm <dmalcolm@redhat.com>2021-04-05 10:48:01 -0400
commit69b66ff02353a87585329bb3cf4ac20d6dee1b16 (patch)
treed65789a51f9c7a14f4b6fcf0f13a157d8a680bd8 /gcc/tree-ssa-dse.c
parentbd89b8fe9efbdf0a95d827553d1a84fd3cefaa16 (diff)
downloadgcc-69b66ff02353a87585329bb3cf4ac20d6dee1b16.zip
gcc-69b66ff02353a87585329bb3cf4ac20d6dee1b16.tar.gz
gcc-69b66ff02353a87585329bb3cf4ac20d6dee1b16.tar.bz2
analyzer: fix apparent hang with -fanalyzer-verbosity=0 [PR analyzer/99886]
The analyzer appeared to enter an infinite loop on malloc-1.c when -fanalyzer-verbosity=0 was used. In fact, it was slowly counting from 0 to 0xffffffff. Root cause is looping up to effectively ((unsigned)0) - 1 in diagnostic_manager::consolidate_conditions when there are no events in the path. Fixed by the following, which uses signed integers when subtracting from path->num_events () when simplifying checker_paths. gcc/analyzer/ChangeLog: PR analyzer/99886 * diagnostic-manager.cc (diagnostic_manager::prune_interproc_events): Use signed integers when subtracting one from path->num_events (). (diagnostic_manager::consolidate_conditions): Likewise. Convert next_idx to a signed int. gcc/testsuite/ChangeLog: PR analyzer/99886 * gcc.dg/analyzer/pr99886.c: New test.
Diffstat (limited to 'gcc/tree-ssa-dse.c')
0 files changed, 0 insertions, 0 deletions