Issue 142504
Summary [CUDA] __constant__ aggregate initializer values return undef in host compilation
Labels cuda
Assignees Artem-B
Reporter Artem-B
    `__constant__` aggregate initializer values return undef in host compilation, but things work when we access individual field values or make a local copy.

Reproducer: https://godbolt.org/z/7ahK78end

```
struct S { int s; };
const __constant__ S const_s = { 77 };

__host__ S works () {
    S s = const_s;
    return s;  // returns {77}
}

__host__ S broken () {
 return const_s;  // returns undef
}
```


_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to