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

compiler bug: Unexpected operation when eliminating struct copying #532

Closed
antoninbas opened this issue Apr 26, 2017 · 2 comments
Closed
Labels
bug This behavior is unintended and should be fixed. fixed This topic is considered to be fixed.

Comments

@antoninbas
Copy link
Member

The attached program gives the following output with p4test and p4c-bm2-ss:

terminate called after throwing an instance of 'Util::CompilerBug'
  what():  COMPILER BUG: ../midend/copyStructures.cpp:45
struct_copying_bug.p4(35): choose_entry(choices);: Unexpected operation when eliminating struct copying
    my_meta.entry = choose_entry(choices);

struct_copying_bug.p4.txt

@antoninbas antoninbas added the bug This behavior is unintended and should be fixed. label Apr 26, 2017
@mihaibudiu
Copy link
Contributor

Indeed, the bmv2 back-end does not handle properly functions that return structures.
But there is no such function in v1model.p4...

This program is not strictly a program that is supported by the p4test and p4c-bm2-ss compilers.
(p4test models the capabilities of p4c-bm2-ss quite closely).

This is a bug because we should not crash, we should just give a nice error message.
A separate question is whether we do need to handle such functions in these back-ends.

mihaibudiu pushed a commit to mihaibudiu/p4c-clone that referenced this issue Apr 26, 2017
@mihaibudiu mihaibudiu added the fixed This topic is considered to be fixed. label Apr 27, 2017
antoninbas pushed a commit that referenced this issue Apr 28, 2017
@mihaibudiu
Copy link
Contributor

I will assume we can close this.

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