p4c icon indicating copy to clipboard operation
p4c copied to clipboard

DPDK backend can generate incorrect intermediate programs

Open mihaibudiu opened this issue 3 years ago • 3 comments

The culprit is the function ConvertBinaryOperationTo2Params::postorder(IR::AssignmentStatement *a) The bug is in handling comparison operations. These consume integers, but produce booleans. The expansion in this function ignores the type and reuses the same temporary variable. Unfortunately I don't have yet a small reproduction, since this happened while fixing other bugs in the compiler.

mihaibudiu avatar Jun 18 '21 01:06 mihaibudiu

In fact there are several programs marked as xfail for the dpdk backend with the error "AssignmentStatement", so I suspect these trigger the same bug.

mihaibudiu avatar Jun 21 '21 21:06 mihaibudiu

@usha1830 @mbudiu-vmw Is this still a bug in the DPDK back end today?

jafingerhut avatar Nov 24 '22 01:11 jafingerhut

I presume this is fixed. We don't have any tests failing with the "AssignmentStatement" error. I also see the function ConvertBinaryOperationTo2Params::postorder(IR::AssignmentStatement *a) does not handle Relational operations https://github.com/p4lang/p4c/blob/main/backends/dpdk/dpdkArch.cpp#L1037

usha1830 avatar Nov 24 '22 03:11 usha1830

Can we close this issue?

fruffy avatar Jun 19 '23 15:06 fruffy