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

Clspv crashes accessing first field after copying other fields with memcpy #1178

Closed
BukeBeyond opened this issue Aug 12, 2023 · 0 comments · Fixed by #1181
Closed

Clspv crashes accessing first field after copying other fields with memcpy #1178

BukeBeyond opened this issue Aug 12, 2023 · 0 comments · Fixed by #1181
Assignees

Comments

@BukeBeyond
Copy link

struct E
{
    int i1, i2, i3; // Fails
    // int i1, i2; // OK, struct smaller
};

struct S
{
  int i1, i2;
  struct E e1, e2;
};

kernel void Kernel(global struct S* s)
{
    s->e1 = s->e2; // memcpy destabilizes the following:
    s->i1 = 0; // Fails, writing first field
    // s->i2 = 0; // OK, second field
    // s->i2 = s->i1; // Fails, reading first field
}

https://godbolt.org/z/h6e4oM8hs

Likely related to #1176 #1177

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

Successfully merging a pull request may close this issue.

2 participants