The old implementation of region_model::get_rvalue_1 gracefully handled
tree codes it didn't understand, returning "UNKNOWN", whereas the new
implementation (
r11-2694-g808f4dfeb3a95f50f15e71148e5c1067f90a126d) had
an assertion left over from development, leading to ICEs.
This patch restores the old behavior for these cases.
gcc/analyzer/ChangeLog:
PR analyzer/96641
* region-model.cc (region_model::get_rvalue_1): Handle
unrecognized tree codes by returning "UNKNOWN.
gcc/testsuite/ChangeLog:
PR analyzer/96641
* g++.dg/analyzer/pr96641.C: New test.
switch (TREE_CODE (pv.m_tree))
{
default:
- gcc_unreachable ();
+ return m_mgr->get_or_create_unknown_svalue (TREE_TYPE (pv.m_tree));
case ADDR_EXPR:
{
--- /dev/null
+struct uh {
+ virtual void
+ sx ();
+};
+
+struct iz : uh {
+ virtual void
+ sx ()
+ {
+ sx ();
+ }
+};
+
+void
+a2 ()
+{
+ iz ().sx ();
+}