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

Lowering of unions with nested structs sometimes incorrect with capabilities #725

Open
arichardson opened this issue Feb 6, 2024 · 1 comment

Comments

@arichardson
Copy link
Member

Structures like the following:

union {
    struct {
        int a;
        __intcap b;
    } c;
    struct {
        __intcap d;
        int e;
    } f;
};

are lowered to IR the same way as one of the struct members, i.e. { i32, ptr addrspace(200) } even though capabilities could exist at offset zero and 8/16.

Unlikely to result in tag-stripping in practice since those unions will be passed indirectly, but could be a problem once 2*CLEN structures are passed in registers.

See #723

@jrtc27
Copy link
Member

jrtc27 commented Feb 6, 2024

Well, SROA would likely have fun with breaking them

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants