From 17976d7401347a7107c01032f8948895dd61ca4b Mon Sep 17 00:00:00 2001 From: Geza Lore Date: Thu, 29 Sep 2022 18:17:58 +0100 Subject: [PATCH] DFG: fix REPLACE_EQ_OF_CONST_AND_CONST peephole pattern --- src/V3DfgPeephole.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/V3DfgPeephole.cpp b/src/V3DfgPeephole.cpp index c27607e21..7ed5ec3c8 100644 --- a/src/V3DfgPeephole.cpp +++ b/src/V3DfgPeephole.cpp @@ -610,9 +610,7 @@ class V3DfgPeephole final : public DfgVisitor { if (DfgConst* const rhsConstp = rhsp->cast()) { APPLYING(REPLACE_EQ_OF_CONST_AND_CONST) { DfgConst* const replacementp = makeZero(vtxp->fileline(), 1); - if (lhsConstp->constp()->sameTree(rhsConstp->constp())) { - replacementp->num().setLong(1); - } + replacementp->num().opEq(lhsConstp->num(), rhsConstp->num()); vtxp->replaceWith(replacementp); return; }