analyzer: fix ICE on unhandled tree codes in gassign [PR96640]
authorDavid Malcolm <dmalcolm@redhat.com>
Mon, 17 Aug 2020 15:53:45 +0000 (11:53 -0400)
committerDavid Malcolm <dmalcolm@redhat.com>
Tue, 18 Aug 2020 00:45:53 +0000 (20:45 -0400)
commit1b0be822208349b2795381deace2352e998c1ad0
treeeee5c1a4412343e249b2df49c2720378231369d2
parentdeee2322a2b36c5f03802e63895a7ce9e814969c
analyzer: fix ICE on unhandled tree codes in gassign [PR96640]

PR analyzer/96640 reports a ICE within region_model::on_assignment when
failing to handle a WIDEN_MULT_EVEN_EXPR, and various other tree codes.

The old implementation of region_model::on_assignment gracefully handled
tree codes it didn't understand, returning "UNKNOWN", whereas the new
implementation (r11-2694-g808f4dfeb3a95f50f15e71148e5c1067f90a126d) had
a "sorry_at" and an assertion left over from development, leading to ICEs.

This patch restores the old behavior for these cases, and marks various
vector operations as leading to unknown results.

gcc/analyzer/ChangeLog:
PR analyzer/96640
* region-model.cc (region_model::get_gassign_result): Handle various
VEC_* tree codes by returning UNKNOWN.
(region_model::on_assignment): Handle unrecognized tree codes by
setting lhs to an unknown value, rather than issuing a "sorry" and
asserting.
gcc/analyzer/region-model.cc