<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 - [NVPTX] Invalid .debug_pubnames in generated PTX with default nameTableKind"
   href="https://bugs.llvm.org/show_bug.cgi?id=44845">44845</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[NVPTX] Invalid .debug_pubnames in generated PTX with default nameTableKind
          </td>
        </tr>

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

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

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

        <tr>
          <th>OS</th>
          <td>All
          </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: PTX
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>timshen91@gmail.com
          </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=23109" name="attach_23109" title="reproducer">attachment 23109</a> <a href="attachment.cgi?id=23109&action=edit" title="reproducer">[details]</a></span>
reproducer

The attached is a modified version of the test case cu-range-hole.ll. The
modification is to remove "nameTableKind: None" in the DICompileUnit metadata.
llc takes it and produces invalid PTX.

ptxas error message:

ptxas /tmp/tmpxft_00033edc_00000000-0_stdin, line 274; fatal   : Parsing error
near '-': syntax error
ptxas fatal   : Ptx assembly aborted due to errors

The offending lines in the generated PTX:

        .section        .debug_pubnames
        {
.b32 LpubNames_end0-LpubNames_begin0    // Length of Public Names Info
LpubNames_begin0:
.b8 2                                   // DWARF Version
.b8 0
.b64 .debug_info                        // Offset of Compilation Unit Info
.b32 188                                // Compilation Unit Length
.b32 102                                // DIE offset
.b8 98                                  // External Name
.b8 0
.b32 141                                // DIE offset
.b8 100                                 // External Name
.b8 0
.b32 0                                  // End Mark
LpubNames_end0:
        }

I looks like PTX doesn't support labels or label arithmetic in sections (or at
all).</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>