Bug in p4c Predication pass with some kinds of if statements inside of action bodies #4370
Labels
bug
This behavior is unintended and should be fixed.
predication-pass
Issues related to p4c's Predication pass
Now that PR #4999 has been merged in, this bug will no longer be reproducible by compiling the given test program for the BMv2 back end. Possible ways to reproduce the issue now:
I believe most occurrences of if statements inside action bodies are handled correctly by p4c, but the example P4 program nested_ifs_in_action-bmv2.p4 in the attached zip file appears to trigger a bug in p4c related to the if statements in its one action. From looking at the output of every compiler pass, the first time a bug is introduced appears to be in the Predication mid-end pass.
The attached program nested_ifs_in_control-bmv2.p4 is functionally the same as nested_ifs_in_action-bmv2.p4, except that all of the if statements are in the ingress control, instead of in an action. Otherwise, their behavior in processing packets should be the same.
I have tested this with the following version of
p4c
source code, but I would guess this bug exists in many other versions of the source code, as I do not think the Predication implementation code changes very often:p4c-issue-4370.zip
The text was updated successfully, but these errors were encountered: