diff --git a/src/V3Const.cpp b/src/V3Const.cpp index f43f31afe..b76c8244b 100644 --- a/src/V3Const.cpp +++ b/src/V3Const.cpp @@ -2053,7 +2053,7 @@ private: VL_DO_DANGLING(nodep->unlinkFrBack()->deleteTree(), nodep); return true; } - } else if (m_doV && VN_IS(nodep->lhsp(), Concat)) { + } else if (m_doV && VN_IS(nodep->lhsp(), Concat) && nodep->isTreePureRecurse()) { bool need_temp = false; if (m_warn && !VN_IS(nodep, AssignDly)) { // Is same var on LHS and RHS? // Note only do this (need user4) when m_warn, which is diff --git a/src/V3Subst.cpp b/src/V3Subst.cpp index eecb39579..38ebafb6a 100644 --- a/src/V3Subst.cpp +++ b/src/V3Subst.cpp @@ -198,7 +198,10 @@ private: } } void visit(AstConst*) override {} // Accelerate - void visit(AstNode* nodep) override { iterateChildren(nodep); } + void visit(AstNode* nodep) override { + if (!nodep->isPure()) m_ok = false; + iterateChildren(nodep); + } public: // CONSTRUCTORS