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 copying array elements of larger structs #1176

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

Clspv crashes copying array elements of larger structs #1176

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

Comments

@BukeBeyond
Copy link

BukeBeyond commented Aug 12, 2023

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

struct S 
{ 
    // int Shift; // OK if array is shifted
    struct E e[3]; 
};

kernel void Kernel(global struct S* s)
{
    s->e[0] = s->e[1]; // Fails, copying to offset 0 of S
    // s->e[1] = s->e[0]; // OK
    // s->e[1] = s->e[2]; // OK
    // s->e[2] = s->e[1]; // OK
}

https://godbolt.org/z/G6Tz8KqME

Updated after discovering that the problem happens at offset 0 of S.
Likely related to #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