File tree 12 files changed +32
-34
lines changed
constant-propagation-function-call
constant_propagator_unreachable 12 files changed +32
-34
lines changed Original file line number Diff line number Diff line change @@ -13,5 +13,6 @@ int main()
13
13
int b ;
14
14
b = nondet ();
15
15
a = f (a );
16
+ assert (a == 4 );
16
17
assert (!(0 <= a && a < 5 && 0 <= b && b < 5 ));
17
18
}
Original file line number Diff line number Diff line change 1
1
CORE
2
2
main.c
3
- --constant-propagator
4
- ^EXIT=10 $
3
+ --verify --constants
4
+ ^EXIT=0 $
5
5
^SIGNAL=0$
6
- Removing returns
7
- VERIFICATION FAILED
8
- ASSIGN main\:\:1\:\:a \:\= 4
9
- ASSERT ¬\(main::1::b ≥ 0\) ∨ main::1::b ≥ 5
6
+ \[main.assertion.1\] line 16 assertion a == 4: SUCCESS
7
+ \[main.assertion.2\] line 17 assertion !\(0 <= a && a < 5 && 0 <= b && b < 5\): UNKNOWN
10
8
--
11
9
^warning: ignoring
12
- ASSERT true
13
10
--
14
11
This tests that constants are propagated through function calls, correctly
15
12
taking into account the return value. Constant propagation should result in
File renamed without changes.
Original file line number Diff line number Diff line change
1
+ CORE
2
+ main.c
3
+ --verify --constants --recursive-interprocedural --loop-unwind 4 --one-domain-per-history
4
+ ^EXIT=0$
5
+ ^SIGNAL=0$
6
+ \[main.assertion.1\] line 17 assertion i \!= n: UNKNOWN
7
+ --
8
+ ^warning: ignoring
File renamed without changes.
Original file line number Diff line number Diff line change
1
+ CORE
2
+ main.c
3
+ --verify --constants
4
+ ^EXIT=0$
5
+ ^SIGNAL=0$
6
+ \[main.assertion.1\] line 7 assertion \*p == 0: SUCCESS
7
+ --
8
+ ^warning: ignoring
File renamed without changes.
Original file line number Diff line number Diff line change 1
1
CORE
2
2
test.c
3
- --constant-propagator
3
+ --verify --constants
4
4
^EXIT=0$
5
5
^SIGNAL=0$
6
- VERIFICATION SUCCESSFUL
6
+ SUCCESS \(unreachable\)
7
7
--
8
8
failed to find state
9
9
--
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -1270,13 +1270,13 @@ void goto_instrument_parse_optionst::instrument_goto_program()
1270
1270
1271
1271
if (cmdline.isset (" constant-propagator" ))
1272
1272
{
1273
- do_indirect_call_and_rtti_removal ();
1274
- do_remove_returns ();
1275
-
1276
- log . status () << " Propagating Constants " << messaget::eom;
1277
-
1278
- constant_propagator_ait constant_propagator_ai (goto_model);
1279
- remove_skip (goto_model) ;
1273
+ log . status () << " --constant-propagator is deprecated, "
1274
+ << " 'goto-analyzer --simplify out.gb "
1275
+ << " --vsd --vsd-value constants' "
1276
+ << " is the recommended replacement but "
1277
+ << " 'goto-analyzer --simplify out.gb --constants' "
1278
+ << " should provide backwards compatability "
1279
+ << messaget::eom ;
1280
1280
}
1281
1281
1282
1282
if (cmdline.isset (" generate-function-body" ))
@@ -1841,7 +1841,6 @@ void goto_instrument_parse_optionst::help()
1841
1841
" single edge back to the loop head\n "
1842
1842
" --drop-unused-functions drop functions trivially unreachable from main function\n " // NOLINT(*)
1843
1843
HELP_REMOVE_POINTERS
1844
- " --constant-propagator propagate constants and simplify expressions\n " // NOLINT(*)
1845
1844
" --inline perform full inlining\n "
1846
1845
" --partial-inline perform partial inlining\n "
1847
1846
" --function-inline <function> transitively inline all calls <function> makes\n " // NOLINT(*)
Original file line number Diff line number Diff line change 47
47
// clang-format off
48
48
// Options that have been moved to goto-analyzer
49
49
#define GOTO_INSTRUMENT_MIGRATED_OPTIONS \
50
+ " (constant-propagator)" \
50
51
" (show-dependence-graph)" \
51
52
" (show-intervals)" \
52
53
// empty last line
94
95
OPT_TIMESTAMP \
95
96
" (show-natural-loops)(show-lexical-loops)(accelerate)(havoc-loops)" \
96
97
" (verbosity):(version)(xml-ui)(json-ui)" \
97
- " (accelerate)(constant-propagator) " \
98
+ " (accelerate)" \
98
99
" (k-induction):(step-case)(base-case)" \
99
100
" (show-call-sequences)(check-call-sequence)" \
100
101
" (interpreter)(show-reaching-definitions)" \
You can’t perform that action at this time.
0 commit comments