-
Notifications
You must be signed in to change notification settings - Fork 273
Improvements to goto-analyzer's constant propagator and simplifier [blocks: #2522] #2132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
64b6a6a
edcf7b8
fe8d1db
87794c5
9e4425a
c23e8ee
2249288
11f92da
e367dbc
2359689
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
FUTURE | ||
CORE | ||
main.c | ||
--constants --simplify out.gb | ||
^EXIT=0$ | ||
^SIGNAL=0$ | ||
^Simplified: assert: 1, assume: 0, goto: 2, assigns: 6, function calls: 0$ | ||
^Simplified: assert: 1, assume: 0, goto: 1, assigns: 6, function calls: 0$ | ||
^Unmodified: assert: 0, assume: 0, goto: 0, assigns: 11, function calls: 2$ | ||
-- | ||
^warning: ignoring |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
FUTURE | ||
CORE | ||
main.c | ||
--constants --simplify out.gb | ||
^EXIT=0$ | ||
^SIGNAL=0$ | ||
^Simplified: assert: 1, assume: 0, goto: 2, assigns: 6, function calls: 0$ | ||
^Simplified: assert: 1, assume: 0, goto: 1, assigns: 6, function calls: 0$ | ||
^Unmodified: assert: 0, assume: 0, goto: 0, assigns: 11, function calls: 2$ | ||
-- | ||
^warning: ignoring |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
FUTURE | ||
CORE | ||
main.c | ||
--constants --verify | ||
^EXIT=0$ | ||
^SIGNAL=0$ | ||
^\[main.assertion.1\] file main.c line 12 function main, assertion j != 3: FAILURE \(if reachable\)$ | ||
^\[main.assertion.1\] line 11 assertion j != 3: FAILURE \(if reachable\)$ | ||
-- | ||
^warning: ignoring |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
FUTURE | ||
CORE | ||
main.c | ||
--constants --simplify out.gb | ||
^EXIT=0$ | ||
^SIGNAL=0$ | ||
^Simplified: assert: 1, assume: 0, goto: 4, assigns: 10, function calls: 0$ | ||
^Unmodified: assert: 0, assume: 0, goto: 1, assigns: 10, function calls: 2$ | ||
^Simplified: assert: 1, assume: 0, goto: 3, assigns: 11, function calls: 0$ | ||
^Unmodified: assert: 0, assume: 0, goto: 1, assigns: 9, function calls: 2$ | ||
-- | ||
^warning: ignoring |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
FUTURE | ||
CORE | ||
main.c | ||
--constants --simplify out.gb | ||
--constants --verify | ||
^EXIT=0$ | ||
^SIGNAL=0$ | ||
^Simplified: assert: 1, assume: 0, goto: 3, assigns: 4, function calls: 0$ | ||
^Unmodified: assert: 0, assume: 0, goto: 0, assigns: 11, function calls: 2$ | ||
^\[main.assertion.1\] line 9 assertion a\[(\(signed( long)? long int\))?0\] == 0: FAILURE \(if reachable\)$ | ||
-- | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure this change matches the commit message of the commit it is in but I guess it is being updated elsewhere in the patch set, in which case it's a bit unnecessary to change it. |
||
^warning: ignoring |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
FUTURE | ||
CORE | ||
main.c | ||
--constants --verify | ||
^EXIT=0$ | ||
^SIGNAL=0$ | ||
^\[main.assertion.1\] file main.c line 10 function main, assertion a\[(\(signed( long)? long int\))?0\] == 2: FAILURE$ | ||
^\[main.assertion.1\] line 10 assertion a\[(\(signed( long)? long int\))?0\] == 2: FAILURE \(if reachable\)$ | ||
-- | ||
^warning: ignoring |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
FUTURE | ||
CORE | ||
main.c | ||
--constants --simplify out.gb | ||
--constants --verify | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again, why change task? |
||
^EXIT=0$ | ||
^SIGNAL=0$ | ||
^Simplified: assert: 1, assume: 0, goto: 0, assigns: 0, function calls: 0$ | ||
^Unmodified: assert: 0, assume: 0, goto: 0, assigns: 0, function calls: 0$ | ||
^\[main.assertion.1\] line 9 assertion a\[(\(signed( long)? long int\))?0\] == 1: SUCCESS$ | ||
-- | ||
^warning: ignoring |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
FUTURE | ||
CORE | ||
main.c | ||
--constants --simplify out.gb | ||
^EXIT=0$ | ||
^SIGNAL=0$ | ||
^Simplified: assert: 1, assume: 0, goto: 1, assigns: 4, function calls: 0$ | ||
^Unmodified: assert: 0, assume: 0, goto: 2, assigns: 11, function calls: 2$ | ||
^Simplified: assert: 1, assume: 0, goto: 1, assigns: 5, function calls: 0$ | ||
^Unmodified: assert: 0, assume: 0, goto: 1, assigns: 10, function calls: 2$ | ||
-- | ||
^warning: ignoring |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
FUTURE | ||
CORE | ||
main.c | ||
--constants --verify | ||
^EXIT=0$ | ||
^SIGNAL=0$ | ||
^\[main.assertion.1\] file main.c line 9 function main, assertion y == 0: FAILURE \(if reachable\)$ | ||
^\[main.assertion.1\] line 9 assertion y == 0: FAILURE \(if reachable\)$ | ||
-- | ||
^warning: ignoring |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
FUTURE | ||
CORE | ||
main.c | ||
--constants --verify | ||
^EXIT=0$ | ||
^SIGNAL=0$ | ||
^\[main.assertion.1\] file main.c line 11 function main, assertion tmp_if_expr: SUCCESS$ | ||
^\[main.assertion.2\] file main.c line 12 function main, assertion tmp_if_expr\$1: FAILURE$ | ||
^\[main.assertion.1\] line 11 assertion tmp_if_expr: SUCCESS$ | ||
^\[main.assertion.2\] line 12 assertion tmp_if_expr\$0: FAILURE \(if reachable\)$ | ||
-- | ||
^warning: ignoring |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
FUTURE | ||
CORE | ||
main.c | ||
--constants --verify | ||
^EXIT=0$ | ||
^SIGNAL=0$ | ||
^\[main.assertion.1\] file main.c line 9 function main, assertion a\[(\(signed( long)? long int\))?0\] == 2: FAILURE$ | ||
^\[main.assertion.1\] line 9 assertion a\[(\(signed( long)? long int\))?0\] == 2: FAILURE \(if reachable\)$ | ||
-- | ||
^warning: ignoring |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#include <assert.h> | ||
|
||
int main() | ||
{ | ||
int i = 1; | ||
int *p = &i; | ||
assert(*p == 1); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
CORE | ||
main.c | ||
--constants --verify | ||
^EXIT=0$ | ||
^SIGNAL=0$ | ||
^\[main.assertion.1\] line 7 assertion \*p == 1: SUCCESS$ | ||
-- | ||
^warning: ignoring |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#include <assert.h> | ||
|
||
int main() | ||
{ | ||
int x; | ||
int *p = &x; | ||
*p = 42; | ||
assert(x == 42); | ||
return 0; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
CORE | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would it be possible to call this new test something a little more descriptive, such as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
main.c | ||
--constants --verify | ||
^EXIT=0$ | ||
^SIGNAL=0$ | ||
^\[main.assertion.1\] line 8 assertion x == 42: SUCCESS$ | ||
-- | ||
^warning: ignoring |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#include <assert.h> | ||
|
||
int main() | ||
{ | ||
int x; | ||
if(x == 0) | ||
{ | ||
assert(!x); | ||
} | ||
return 0; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
CORE | ||
main.c | ||
--constants --verify | ||
^EXIT=0$ | ||
^SIGNAL=0$ | ||
^\[main.assertion.1\] line 8 assertion !x: SUCCESS$ | ||
-- | ||
^warning: ignoring |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
KNOWNBUG | ||
FUTURE | ||
main.c | ||
--variable --pointers --arrays --structs --verify | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These should be future, also, the names for options should change. |
||
^EXIT=0$ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why has this changed task?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For completeness: I have changed the task here as simplification did always take place, but not enough of it to actually turn the assertion into a firm
FALSE
.