Skip to content
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

Missed side-effect case StrengthReduction #2287

Closed
fruffy opened this issue Apr 6, 2020 · 0 comments
Closed

Missed side-effect case StrengthReduction #2287

fruffy opened this issue Apr 6, 2020 · 0 comments
Assignees
Labels
bug This behavior is unintended and should be fixed. fixed This topic is considered to be fixed.

Comments

@fruffy
Copy link
Collaborator

fruffy commented Apr 6, 2020

A follow-up on issue #2221. We missed concat for StrengthReduction.

dummy_var = (h.h.p ++ function_with_side_effect(h.h.p))[15:8];
turns into
dummy_var = h.h.p;
because the compiler thinks it can remove the right-hand statement.

I attached an augmented test and the corresponding stf file.
2221_concat.p4.txt
2221_concat.stf.txt

mihaibudiu pushed a commit to mihaibudiu/p4c-clone that referenced this issue Apr 6, 2020
@mihaibudiu mihaibudiu added bug This behavior is unintended and should be fixed. fixed This topic is considered to be fixed. labels Apr 6, 2020
@mihaibudiu mihaibudiu self-assigned this Apr 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This behavior is unintended and should be fixed. fixed This topic is considered to be fixed.
Projects
None yet
Development

No branches or pull requests

2 participants