Skip to content

Commit 15b501c

Browse files
Use ai_simplify in unwind_bounds to support FP operations
1 parent e468915 commit 15b501c

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#define N (int)( (10./2.) + 0.5)
2+
3+
void some(void);
4+
5+
void main(void)
6+
{
7+
int i;
8+
for (i=0; i<N; i++)
9+
some();
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
main.c
3+
--unwind-bounds
4+
^main.0: 5$
5+
^EXIT=0$
6+
^SIGNAL=0$
7+
--
8+
^warning: ignoring

src/analyses/unwind_bounds.cpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -520,8 +520,7 @@ void unwind_boundst::handle_self_loop(
520520

521521
exprt cond=loop->guard;
522522

523-
entry_state.values.replace_const.replace(cond);
524-
cond=simplify_expr(cond, ns);
523+
entry_state.ai_simplify(cond, ns);
525524

526525
bool c=cond.is_false();
527526

@@ -605,8 +604,7 @@ void unwind_boundst::handle_loop(
605604
while(true)
606605
{
607606
exprt cond=loop_cond(loop);
608-
next_entry_state.values.replace_const.replace(cond);
609-
cond=simplify_expr(cond, ns);
607+
next_entry_state.ai_simplify(cond, ns);
610608

611609
bool c=cond.is_false();
612610

0 commit comments

Comments
 (0)