Fix X shift issue, bug772.

This commit is contained in:
Wilson Snyder
2014-05-24 07:05:23 -04:00
parent dcf351f847
commit 91e706ec1f
3 changed files with 9 additions and 1 deletions
+2
View File
@@ -274,6 +274,8 @@ private:
// We can only get rid of a<<b>>c or a<<b<<c, with constant b & c
// because bits may be masked in that process, or (b+c) may exceed the word width.
if (!(nodep->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;