Skip to content

Commit ca9fcb7

Browse files
smowtontautschnig
authored andcommitted
Temporarily disable field-sensitivity for arrays
The Array_Propagation1 test is no longer solved during symex in this case.
1 parent 6e514de commit ca9fcb7

File tree

4 files changed

+18
-4
lines changed

4 files changed

+18
-4
lines changed

regression/cbmc-concurrency/struct_and_array1/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
KNOWNBUG
22
main.c
33

44
^EXIT=0$
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
KNOWNBUG
22
main.c
33

44
^EXIT=0$
@@ -7,3 +7,7 @@ main.c
77
(Starting CEGAR Loop|VCC\(s\), 0 remaining after simplification$)
88
--
99
^warning: ignoring
10+
--
11+
This requires field-sensitive SSA encoding of arrays to pass entirely via
12+
constant propagation (changing the above condition to "1 remaining after
13+
simplification" would also make it pass, but this isn't the point of the test).

regression/cbmc/variable-access-to-constant-array/test.desc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
THOROUGH broken-smt-backend
1+
CORE broken-smt-backend
22
main.c
33

44
^EXIT=10$
@@ -12,4 +12,4 @@ do so.
1212

1313
Field-sensitive encoding of array accesses for an array of 2^16 elements is very
1414
expensive. We might consider some bounds up to which we actually do field
15-
expansion.
15+
expansion, or at least need to mark this test as "THOROUGH."

src/goto-symex/field_sensitivity.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ Author: Michael Tautschnig
1616
#include "goto_symex_state.h"
1717
#include "symex_target.h"
1818

19+
// #define ENABLE_ARRAY_FIELD_SENSITIVITY
20+
1921
void field_sensitivityt::apply(const namespacet &ns, exprt &expr, bool write)
2022
const
2123
{
@@ -38,12 +40,14 @@ void field_sensitivityt::apply(const namespacet &ns, exprt &expr, bool write)
3840
{
3941
simplify(expr, ns);
4042
}
43+
#ifdef ENABLE_ARRAY_FIELD_SENSITIVITY
4144
else if(
4245
!write && expr.id() == ID_index &&
4346
to_index_expr(expr).array().id() == ID_array)
4447
{
4548
simplify(expr, ns);
4649
}
50+
#endif // ENABLE_ARRAY_FIELD_SENSITIVITY
4751
else if(expr.id() == ID_member)
4852
{
4953
// turn a member-of-an-SSA-expression into a single SSA expression, thus
@@ -66,6 +70,7 @@ void field_sensitivityt::apply(const namespacet &ns, exprt &expr, bool write)
6670
expr.swap(tmp);
6771
}
6872
}
73+
#ifdef ENABLE_ARRAY_FIELD_SENSITIVITY
6974
else if(expr.id() == ID_index)
7075
{
7176
// turn a index-of-an-SSA-expression into a single SSA expression, thus
@@ -89,6 +94,7 @@ void field_sensitivityt::apply(const namespacet &ns, exprt &expr, bool write)
8994
expr.swap(tmp);
9095
}
9196
}
97+
#endif // ENABLE_ARRAY_FIELD_SENSITIVITY
9298
}
9399

94100
exprt field_sensitivityt::get_fields(
@@ -115,6 +121,7 @@ exprt field_sensitivityt::get_fields(
115121

116122
return std::move(result);
117123
}
124+
#ifdef ENABLE_ARRAY_FIELD_SENSITIVITY
118125
else if(
119126
ssa_expr.type().id() == ID_array &&
120127
to_array_type(ssa_expr.type()).size().id() == ID_constant)
@@ -138,6 +145,7 @@ exprt field_sensitivityt::get_fields(
138145

139146
return std::move(result);
140147
}
148+
#endif // ENABLE_ARRAY_FIELD_SENSITIVITY
141149
else
142150
return ssa_expr;
143151
}
@@ -212,6 +220,7 @@ void field_sensitivityt::field_assignments_rec(
212220
++fs_it;
213221
}
214222
}
223+
#ifdef ENABLE_ARRAY_FIELD_SENSITIVITY
215224
else if(const auto &type = type_try_dynamic_cast<array_typet>(lhs.type()))
216225
{
217226
const std::size_t array_size =
@@ -229,6 +238,7 @@ void field_sensitivityt::field_assignments_rec(
229238
++fs_it;
230239
}
231240
}
241+
#endif // ENABLE_ARRAY_FIELD_SENSITIVITY
232242
else if(lhs_fs.has_operands())
233243
{
234244
PRECONDITION(

0 commit comments

Comments
 (0)