[Suif-talk] Really nasty bug in SUIF's dismantle_for_statements
nkavv at physics.auth.gr
nkavv at physics.auth.gr
Fri Jun 9 06:04:25 PDT 2006
Hi there SUIFers and MachSUIFers
i have just found a really nasty bug in the suif-2 (2.2.0-4) sources in the
implementation of "dismantle_for_statements" in
./nci/suif/suif2b/basepasses/transforms/statement_dismantlers.cpp
It seems that when using the "dismantle_cfors_to_fors" option for the task of
lowering SUIF code to SUIFvm (in order to continue working with Machine SUIF 2)
the upper bound of SUIF-level CFor statements is not handled correctly. Instead,
the step Expression is passed on by mistake.
Here is the patch:
diff -ruN nci/suif/suif2b/basepasses/transforms/statement_dismantlers.cpp
nci.orig/suif/suif2b/basepasses/transforms/statement_dismantlers.cpp
--- nci/suif/suif2b/basepasses/transforms/statement_dismantlers.cpp 2006-06-09
15:42:43.000000000 +0300
+++
nci.orig/suif/suif2b/basepasses/transforms/statement_dismantlers.cpp 2000-06-05
13:42:02.000000000 +0300
@@ -415,7 +415,7 @@
create_binary_expression(body->get_suif_env(),type,
compare_op,
deep_suif_clone<Expression>(index_expr),
- deep_suif_clone<Expression>(upper));
+ deep_suif_clone<Expression>(step));
replacement->append_statement(create_branch_statement(body->get_suif_env(),compare,continue_lab));
// end of loop
Cheers
Nikolaos Kavvadias
Physics Dept.
Electronics Lab
Aristotle Univ. of Thessaloniki
Thessaloniki, Greece
More information about the Suif-talk
mailing list