diff --git a/src/V3Clean.cpp b/src/V3Clean.cpp index 303480fd2..f69d0e153 100644 --- a/src/V3Clean.cpp +++ b/src/V3Clean.cpp @@ -234,6 +234,11 @@ private: operandTriop(nodep); setClean(nodep, nodep->cleanOut()); } + void visit(AstStructSel* nodep) override { + iterateChildren(nodep); + AstStructDType* dtypep = VN_CAST(nodep->dtypep()->skipRefp(), StructDType); + setClean(nodep, dtypep && !dtypep->packed()); + } void visit(AstUCFunc* nodep) override { iterateChildren(nodep); computeCppWidth(nodep); diff --git a/test_regress/t/t_unpacked_struct_eq.v b/test_regress/t/t_unpacked_struct_eq.v index 726922e24..5757cae2e 100644 --- a/test_regress/t/t_unpacked_struct_eq.v +++ b/test_regress/t/t_unpacked_struct_eq.v @@ -38,9 +38,8 @@ module t; assign s2.arr[1] = 8'h33; initial begin - if(s1 != s2) begin - $fatal; - end + if(s1 != s2) $stop; + if(s1.sub != s2.sub) $stop; if(s1 == s2) begin $write("*-* All Finished *-*\n"); $finish;