<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - OpenMP offload reduction on complex type on AMD GPU"
   href="https://bugs.llvm.org/show_bug.cgi?id=52108">52108</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>OpenMP offload reduction on complex type on AMD GPU
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>OpenMP
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>xw111luoye@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre><a href="https://github.com/ye-luo/openmp-target/blob/master/tests/complex/complex_reduction.cpp">https://github.com/ye-luo/openmp-target/blob/master/tests/complex/complex_reduction.cpp</a>

# good on nvptx64
clang++ -fopenmp -march=native -fopenmp-targets=nvptx64 -O3 -DNDEBUG
-ffast-math  complex_reduction.cpp -lm && ./a.out
# compiler crash on amdgcn
clang++ -fopenmp -march=native -fopenmp-targets=amdgcn-amd-amdhsa
-Xopenmp-target=amdgcn-amd-amdhsa -march=gfx906 -O3 -DNDEBUG -ffast-math
complex_reduction.cpp -lm
# use openmp-opt-disable, the run goes wrong
clang++ -fopenmp -march=native -fopenmp-targets=amdgcn-amd-amdhsa
-Xopenmp-target=amdgcn-amd-amdhsa -march=gfx906 -O3 -DNDEBUG -ffast-math -mllvm
-openmp-opt-disable=true  complex_reduction.cpp -lm && ./a.out
[GPU Memory Error] Addr: 0x9e8237987000 Reason: Page not present or supervisor
privilege. 
Memory access fault by GPU node-1 (Agent handle: 0x18b1150) on address
0x9e8237987000. Reason: Page not present or supervisor privilege.
Aborted (core dumped)

One more related reproducer
llvm-project/openmp/libomptarget/test/offloading/<a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - hierarchical parallelism hangs"
   href="show_bug.cgi?id=49021">bug49021</a>.cpp 

I got wrong results
clang++ -fopenmp -march=native -fopenmp-targets=amdgcn-amd-amdhsa
-Xopenmp-target=amdgcn-amd-amdhsa -march=gfx906 -O3 -DNDEBUG -ffast-math
<a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - hierarchical parallelism hangs"
   href="show_bug.cgi?id=49021">bug49021</a>.cpp

# use openmp-opt-disable, the run goes wrong
clang++ -fopenmp -march=native -fopenmp-targets=amdgcn-amd-amdhsa
-Xopenmp-target=amdgcn-amd-amdhsa -march=gfx906 -O3 -DNDEBUG -ffast-math -mllvm
-openmp-opt-disable=true <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - hierarchical parallelism hangs"
   href="show_bug.cgi?id=49021">bug49021</a>.cpp
[GPU Memory Error]</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>