diff --git a/src/V3Dead.cpp b/src/V3Dead.cpp index 761fbe1a2..312f64bf6 100644 --- a/src/V3Dead.cpp +++ b/src/V3Dead.cpp @@ -187,7 +187,7 @@ class DeadVisitor final : public VNVisitor { void visit(AstModportFTaskRef* nodep) override { iterateChildren(nodep); checkAll(nodep); - if (nodep->ftaskp()) nodep->ftaskp()->user1(1); + if (nodep->ftaskp()) nodep->ftaskp()->user1Inc(); } void visit(AstRefDType* nodep) override { iterateChildren(nodep); diff --git a/test_regress/t/t_opt_dead.v b/test_regress/t/t_opt_dead.v index 4db94ac09..1888acdce 100644 --- a/test_regress/t/t_opt_dead.v +++ b/test_regress/t/t_opt_dead.v @@ -44,6 +44,20 @@ interface If_Dead; modport modport_Dead(import if_func_Dead); endinterface +interface Dead_caller_if; + task automatic imported_task_Dead; + endtask + modport mp_Dead(import imported_task_Dead); +endinterface + +module Dead_caller_test; + Dead_caller_if di (); + + task automatic uncalled_caller_Dead; + di.imported_task_Dead; + endtask +endmodule + package Pkg_public_kpt; parameter int public_int_Keep /*verilator public_flat_rd*/ = 5; endpackage @@ -76,6 +90,7 @@ module t ( /*AUTOARG*/); Mod_Empty_Dead cell_empty_Dead (); Mod_Parent_Empty_Dead cell_parent_empty_Dead (); + Dead_caller_test dead_caller_test_i (); typedef_Dead1_t assigned_to_Dead1; typedef_Dead2_t assigned_to_Dead2;