diff --git a/src/V3Changed.cpp b/src/V3Changed.cpp index dc3343f87..589a681ac 100644 --- a/src/V3Changed.cpp +++ b/src/V3Changed.cpp @@ -151,8 +151,11 @@ private: AstAssign* const initp = new AstAssign{m_vscp->fileline(), m_newLvEqnp->cloneTree(true), m_varEqnp->cloneTree(true)}; m_statep->m_chgFuncp->addFinalsp(initp); + + // Later code will expand words which adds to GCC compile time, + // so add penalty based on word width also EmitCBaseCounterVisitor visitor{initp}; - m_statep->m_numStmts += visitor.count(); + m_statep->m_numStmts += visitor.count() + m_varEqnp->widthWords(); } virtual void visit(AstBasicDType*) override { // diff --git a/src/V3EmitCBase.h b/src/V3EmitCBase.h index 0b34a525e..dcebb4484 100644 --- a/src/V3EmitCBase.h +++ b/src/V3EmitCBase.h @@ -122,7 +122,7 @@ private: int m_count = 0; // Number of statements // VISITORS virtual void visit(AstNode* nodep) override { - m_count++; + ++m_count; iterateChildren(nodep); }