Skip to content

Commit 5d1964d

Browse files
committed
Field sensitivity for unions
Field-sensitive tracking of unions permits propagating constants even when those do not affect the full width of the union (implying that some bits remain non-constant).
1 parent 91ea53f commit 5d1964d

File tree

15 files changed

+280
-49
lines changed

15 files changed

+280
-49
lines changed

regression/cbmc/Float22/test.desc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
CORE broken-cprover-smt-backend
1+
CORE
22
main.c
33
--floatbv
44
^EXIT=0$
55
^SIGNAL=0$
66
^VERIFICATION SUCCESSFUL$
77
--
88
^warning: ignoring
9-
--
10-
Fixing this test for the CPROVER SMT2 solver (or any other SMT2 solver
11-
supporting FPA) requires addressing the TODO "bit-wise floatbv to bv".

regression/cbmc/Pointer_Arithmetic19/test.desc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
CORE new-smt-backend
22
main.c
33
--program-only
4-
ASSERT\(byte_extract_little_endian\(\{ 42, 43 \}, POINTER_OFFSET\(p!0@1#2\), signed int\) == 43\)$
54
^EXIT=0$
65
^SIGNAL=0$
76
--

regression/cbmc/array-cell-sensitivity15/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ access.c
33
--program-only
44
^EXIT=0$
55
^SIGNAL=0$
6-
s!0@1#1\.\.n == \{ s!0@1#1\.\.n\[\[0\]\], s!0@1#1\.\.n\[\[1\]\], s!0@1#1\.\.n\[\[2\]\], s!0@1#1\.\.n\[\[3\]\] } WITH \[\(.*\)i!0@1#2:=k!0@1#1\]
6+
s!0@1#2\.\.n == \{ s!0@1#1\.\.n\[\[0\]\], s!0@1#1\.\.n\[\[1\]\], s!0@1#1\.\.n\[\[2\]\], s!0@1#1\.\.n\[\[3\]\] } WITH \[\(.*\)i!0@1#2:=k!0@1#1\]
77
--
88
byte_update
99
--

regression/cbmc/array-cell-sensitivity8/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ main::1::array!0@1#2\[\[6\]\] =
1010
main::1::array!0@1#2\[\[7\]\] =
1111
main::1::array!0@1#2\[\[8\]\] =
1212
main::1::array!0@1#2\[\[9\]\] =
13-
main::1::array!0@1#2 =.*byte_extract_little_endian
13+
main::1::array!0@1#3 =.*byte_extract_little_endian
1414
main::1::array!0@1#3\[\[0\]\] =
1515
main::1::array!0@1#3\[\[1\]\] =
1616
main::1::array!0@1#3\[\[2\]\] =

regression/cbmc/field-sensitivity9/test.desc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
CORE
22
test.c
33
--show-vcc
4-
main::1::a1!0@1#1 =
5-
main::1::a2!0@1#1 =
4+
main::1::a1!0@1#2 =
5+
main::1::a2!0@1#2 =
66
main::1::a1!0@1#2\.\.x =
77
main::1::a1!0@1#2\.\.y =
88
main::1::a1!0@1#2\.\.z =

regression/cbmc/gcc_vector1/test.desc

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

44
^EXIT=0$

regression/cbmc/union18/main.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#include <assert.h>
2+
3+
union u_type
4+
{
5+
int i;
6+
char ch;
7+
};
8+
9+
int main()
10+
{
11+
union u_type u;
12+
13+
u.ch = 2;
14+
assert(u.ch == 2);
15+
}

regression/cbmc/union18/test.desc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
CORE
2+
main.c
3+
4+
^Generated 1 VCC\(s\), 0 remaining after simplification$
5+
^VERIFICATION SUCCESSFUL$
6+
^EXIT=0$
7+
^SIGNAL=0$
8+
--
9+
^warning: ignoring
10+
--
11+
This should be fully solved by constant propagation when union field-sensitivity
12+
is in place.

0 commit comments

Comments
 (0)