diff --git a/passes/techmap/extract_fa.cc b/passes/techmap/extract_fa.cc index 117fdd54cf6..781cdceb53f 100644 --- a/passes/techmap/extract_fa.cc +++ b/passes/techmap/extract_fa.cc @@ -413,13 +413,13 @@ struct ExtractFaWorker } if (func3.at(key).count(xor3_func)) { - SigBit YY = invert_xy ? module->NotGate(NEW_ID, Y) : Y; + SigBit YY = invert_xy != f3i.inv_y ? module->NotGate(NEW_ID, Y) : Y; for (auto bit : func3.at(key).at(xor3_func)) assign_new_driver(bit, YY); } if (func3.at(key).count(xnor3_func)) { - SigBit YY = invert_xy ? Y : module->NotGate(NEW_ID, Y); + SigBit YY = invert_xy != f3i.inv_y ? Y : module->NotGate(NEW_ID, Y); for (auto bit : func3.at(key).at(xnor3_func)) assign_new_driver(bit, YY); } diff --git a/tests/various/bug3879.ys b/tests/various/bug3879.ys new file mode 100644 index 00000000000..7163a1f567f --- /dev/null +++ b/tests/various/bug3879.ys @@ -0,0 +1,29 @@ +read_verilog <