[AMDGPU] HIP miscompilation bug (aggregate assignment of nested unions)
The following HIP program triggers a miscompilation bug. The output should be a deterministic value as it's UB free. The bug manifests by enabling optimisations which cause a divergence in the printed value.
Test File: HIPProg.hip
How to reproduce:
clang++ -O0 -x hip HIPProg.hip -Wno-c++11-narrowing --offload-arch=native -o O0.outclang++ -O1 -x hip HIPProg.hip -Wno-c++11-narrowing --offload-arch=native -o O1.out./O0.out./O1.out
Compare output values: Bug (-O1): 589824 Ref (-O0): 0
tagging @mgcarrasco who is working on it confirmed in commit a4cd17e
@llvm/issue-subscribers-backend-amdgpu
Author: ElliotBLabs
Test File: HIPProg.hip
How to reproduce:
clang++ -O0 -x hip HIPProg.hip -Wno-c++11-narrowing --offload-arch=native -o O0.outclang++ -O1 -x hip HIPProg.hip -Wno-c++11-narrowing --offload-arch=native -o O1.out./O0.out./O1.out
Compare output values: Bug (-O1): 589824 Ref (-O0): 0
Can you use more specific / unique titles? There are now at least 4 issues open with identical titles
Can you use more specific / unique titles? There are now at least 4 issues open with identical titles
We can also refine them when more is known about the pass/reason for the miscompilation.