From c6198ea5a833008789ecbc9cc4da3ab61fcf4e82 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Sat, 13 Apr 2013 21:18:24 +0200 Subject: Fixed a bug in opt_const when optimizing 1-bit compares with constants --- passes/opt/opt_const.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/passes/opt/opt_const.cc b/passes/opt/opt_const.cc index 0effd964..7c82f0fc 100644 --- a/passes/opt/opt_const.cc +++ b/passes/opt/opt_const.cc @@ -181,8 +181,10 @@ void replace_const_cells(RTLIL::Design *design, RTLIL::Module *module) RTLIL::SigSpec b = assign_map(cell->connections["\\B"]); if (a.is_fully_const()) { - RTLIL::SigSpec tmp = a; - a = b, b = tmp; + RTLIL::SigSpec tmp; + tmp = a, a = b, b = tmp; + cell->connections["\\A"] = a; + cell->connections["\\B"] = b; } if (b.is_fully_const()) { -- cgit v1.2.3