Closed jafingerhut closed 1 month ago
The second attached program has a finite loop, but p4c unrolls it with only 2 iterations, when it should have 4 iterations
What these examples have in common is that the loop variable wraps around during one or more update steps.
Closing this issue, as it is now fixed by this PR: https://github.com/p4lang/p4c/pull/4967
See the attached test program. As of 2024-Oct-16, the latest p4c unrolls the loop as if it terminates, but it is actually an infinite loop. loop-3-clause-tricky1.p4.txt
@ChrisDodd