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

Invalid OpPtrAccessChain into a Function Storage pointer #1360

Open
bmanga opened this issue May 23, 2024 · 0 comments
Open

Invalid OpPtrAccessChain into a Function Storage pointer #1360

bmanga opened this issue May 23, 2024 · 0 comments

Comments

@bmanga
Copy link
Contributor

bmanga commented May 23, 2024

The following:

struct InstanceTest
{
  uint data1_;
  uint data2_;
  uint data3_;
};

__kernel void test(__global InstanceTest* dst)
{
  const size_t index = get_global_id(0);
  InstanceTest instances[2];

  if (index < 2) {
    dst[index] = instances[index];
  }
}

Generates a OpPtrAccessChain into a function storage pointer:

%35 = OpPtrAccessChain %_ptr_Function_uint %33 %uint_3

https://gcc.godbolt.org/z/oz5MGoWd5

I don't think this is valid.
See also #135

@bmanga bmanga changed the title Invalid OpPtrAccessChain into a Function Storage class Invalid OpPtrAccessChain into a Function Storage pointer May 23, 2024
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

1 participant