Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

[NVPTX] Invalid .debug_pubnames in generated PTX with default nameTableKind #43815

Open Quuxplusone opened 4 years ago

Quuxplusone commented 4 years ago
Bugzilla Link PR44845
Status NEW
Importance P enhancement
Reported by Tim Shen (timshen91@gmail.com)
Reported on 2020-02-07 18:13:46 -0800
Last modified on 2020-02-07 18:15:50 -0800
Version trunk
Hardware PC All
CC a.bataev@hotmail.com, llvm-bugs@lists.llvm.org, timshen91@gmail.com
Fixed by commit(s)
Attachments file_44845.txt (2778 bytes, text/plain)
Blocks
Blocked by
See also
Created attachment 23109
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).
Quuxplusone commented 4 years ago

Attached file_44845.txt (2778 bytes, text/plain): reproducer