-
Notifications
You must be signed in to change notification settings - Fork 446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
InlineFunctions pass sometime seems to generate invalid code. #2126
Comments
I tried reproducing this, but with latest p4c source code built, I get errors about the |
Never mind. I figured it out. By default, if you run a copy of p4c that you have installed using |
Right. I just used --top4 and --dump yesterday with latest p4c and see no problems. I always use |
I don't see the error on the file you mentioned, but I do on the file It appears the errors should not be issued, though, since the variables are scoped locally within a block |
It looks like an issue only in parser code. The same p4i file has |
The attached program is close to minimal one that exhibits the bug. When I attempt to compile it with the 2020-Jan-04 master version of p4c, I get this error, which appears to me like no such error should occur:
|
The |
I accidentally provided the first pass where the issue is fixed again after InlineFunctions. I edited the post. |
There are several problems, but one of them is certainly a bug - the one highlighted by Andy. |
The intermediate output after the InlineFunctions pass occasionally leads to invalid P4 code.
If we compile issue1538.p4 with
./p4c/build/p4c --top4 FrontEnd,MidEnd --dump dmp p4c/testdata/p4_16_samples/issue1538.p4
and then try to run./p4c/build/p4c dmp/issue1538-FrontEnd_44_InlineFunctions.p4i
on the generated file we get the following output:
The text was updated successfully, but these errors were encountered: