<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 - llvm-mc: ICE in llvm::AMDGPUInstPrinter::printU32ImmOperand for mattr=-code-object-v3 -mcpu=fiji"
   href="https://bugs.llvm.org/show_bug.cgi?id=45887">45887</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>llvm-mc: ICE in llvm::AMDGPUInstPrinter::printU32ImmOperand for mattr=-code-object-v3 -mcpu=fiji
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>10.0
          </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>Backend: AMDGPU
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>burnus@net-b.de
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=23472" name="attach_23472" title="cc7kNLGI.mkoffload.2.s – assemble with: llvm-mc  -mattr=-code-object-v3 -mcpu=fiji">attachment 23472</a> <a href="attachment.cgi?id=23472&action=edit" title="cc7kNLGI.mkoffload.2.s – assemble with: llvm-mc  -mattr=-code-object-v3 -mcpu=fiji">[details]</a></span>
cc7kNLGI.mkoffload.2.s – assemble with: llvm-mc  -mattr=-code-object-v3
-mcpu=fiji

Running the following command

/usr/bin/llvm-mc-10.0.0 -triple=amdgcn--amdhsa -mattr=-code-object-v3
-mcpu=fiji -filetype=obj -o /tmp/ccjCfcds.o cc7kNLGI.mkoffload.2.s

Gives a segfault (see below). At least it fails with OpenSUSE's LLVM 10 and
LLVM 9 and also with Debian's LLVM 9/10. The assembler file has been generated
with GCC 10, but in any case an ICE is wrong.
[Cf. also <a href="https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94278">https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94278</a>]


llvm::raw_ostream::operator<< (this=0x1, Fmt=...) at
../lib/Support/raw_ostream.cpp:309
309       size_t BufferBytesLeft = OutBufEnd - OutBufCur;

#1  0x00007ffff56d2388 in llvm::AMDGPUInstPrinter::printU32ImmOperand
(this=0x48a201, MI=0x48af18, OpNo=2, STI=..., O=...) at
../lib/Target/AMDGPU/MCTargetDesc/AMDGPUInstPrinter.cpp:78
78        O << formatHex(MI->getOperand(OpNo).getImm() & 0xffffffff);
(gdb) bt
#0  llvm::raw_ostream::operator<< (this=0x1, Fmt=...) at
../lib/Support/raw_ostream.cpp:309
#1  0x00007ffff56d2388 in llvm::AMDGPUInstPrinter::printU32ImmOperand
(this=0x48a201, MI=0x48af18, OpNo=2, STI=..., O=...) at
../lib/Target/AMDGPU/MCTargetDesc/AMDGPUInstPrinter.cpp:78
#2  llvm::AMDGPUInstPrinter::printInstruction (this=0x48a201, MI=<optimized
out>, Address=<optimized out>, STI=warning: RTTI symbol not found for class
'(anonymous namespace)::ELFSingleObjectWriter [clone
.llvm.9618930050404732398]'
..., O=...) at lib/Target/AMDGPU/AMDGPUGenAsmWriter.inc:33103</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>