From e328c5a7135e609809f6bd328179bec31e4c7797 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Mon, 8 Jun 2020 18:54:10 -0400 Subject: [PATCH 216/315] FIXME: hackish fix for setjmp issues --- gcc/analyzer/store2.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/gcc/analyzer/store2.cc b/gcc/analyzer/store2.cc index 5a21699176e..c53ffdc9358 100644 --- a/gcc/analyzer/store2.cc +++ b/gcc/analyzer/store2.cc @@ -650,6 +650,20 @@ binding_cluster2::can_merge_p (const binding_cluster2 *cluster_a, const svalue2 *sval_a = cluster_a->get_any_value (key); const svalue2 *sval_b = cluster_b->get_any_value (key); + /* FIXME: hack! + The existing setjmp tests show the control flow properly, + distinguising between the zero and nonzero return paths + from setjmp. + This only worked in the old implementation because + model_merger::can_merge_values_p happened to reject attempts + to merge a region_model containing an SK_SETJMP value. + In the new implementation these will be trivially merged as + they as the same svalue2. So for now, reject any merger + involving an setjmp_svalue2. */ + if ((sval_a && sval_a->get_kind () == svalue2::SK_SETJMP) + || (sval_b && sval_b->get_kind () == svalue2::SK_SETJMP)) + return false; + if (sval_a == sval_b) { gcc_assert (sval_a); -- 2.26.2