diff --git a/Changes b/Changes index cc6966a12..4f3de61d1 100644 --- a/Changes +++ b/Changes @@ -9,7 +9,7 @@ indicates the contributor was also the author of the fix; Thanks! *** Support SV 2012 package import before port list. -**** Fix huge shifts to zero with -Wno-WIDTH, bug765, bug766, bug768. [Clifford Wolf] +**** Fix shift corner issues, bug765, bug766, bug768, bug772. [Clifford Wolf] **** Fix gate primitives with arrays and non-arrayed pins. diff --git a/src/V3Const.cpp b/src/V3Const.cpp index 60222415d..f7bdffc5a 100644 --- a/src/V3Const.cpp +++ b/src/V3Const.cpp @@ -274,6 +274,8 @@ private: // We can only get rid of a<>c or a<rhsp()->castConst() && lhsp->rhsp()->castConst())) return false; + if (nodep->rhsp()->castConst()->num().isFourState() + || lhsp->rhsp()->castConst()->num().isFourState()) return false; if (nodep->width()!=lhsp->width()) return false; if (nodep->width()!=lhsp->lhsp()->width()) return false; return true; diff --git a/test_regress/t/t_math_signed5.v b/test_regress/t/t_math_signed5.v index 0222e048e..26740b20f 100644 --- a/test_regress/t/t_math_signed5.v +++ b/test_regress/t/t_math_signed5.v @@ -133,6 +133,12 @@ w4_u = $signed(5'd1 > w4_s-w4_s); `checkh(w4_u, 4'b1111); + // bug772 + w4_s = w4_u << 1 <<< 0/0; +`ifndef VERILATOR // In v4 can't check value as not 4-state + `checkh(w4_s, 4'bxxxx); +`endif + if (fail) $stop; $write("*-* All Finished *-*\n"); $finish;