diff --git a/passes/proc/proc_clean.cc b/passes/proc/proc_clean.cc index 45872907b..6ce2f8cb0 100644 --- a/passes/proc/proc_clean.cc +++ b/passes/proc/proc_clean.cc @@ -41,7 +41,7 @@ void proc_clean_switch(RTLIL::SwitchRule *sw, RTLIL::CaseRule *parent, bool &did break; for (int j = 0; j < int(cs->compare.size()); j++) { RTLIL::SigSpec &val = cs->compare[j]; - if (!val.is_fully_const()) + if (!val.is_fully_def()) continue; if (val == sw->signal) { cs->compare.clear(); diff --git a/tests/proc/clean_undef_case.ys b/tests/proc/clean_undef_case.ys new file mode 100644 index 000000000..3c29c93bc --- /dev/null +++ b/tests/proc/clean_undef_case.ys @@ -0,0 +1,22 @@ +read_rtlil <