[llvm-bugs] [Bug 48678] New: Crash with inline asm using wrong register name

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jan 6 12:08:50 PST 2021


https://bugs.llvm.org/show_bug.cgi?id=48678

            Bug ID: 48678
           Summary: Crash with inline asm using wrong register name
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Common Code Generator Code
          Assignee: unassignedbugs at nondot.org
          Reporter: paul_robinson at playstation.sony.com
                CC: llvm-bugs at lists.llvm.org

https://godbolt.org/z/ne1j4h

In a Release build (which is what godbolt has) the crash is in 
pass 'Post-RA pseudo instruction expansion pass'.
In an Asserts build that I did myself, I get

clang:
/home/probinson/projects/llvm-org/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:8072:
void GetRegistersForValue(llvm::SelectionDAG&, const llvm::SDLoc&,
{anonymous}::SDISelAsmOperandInfo&, {anonymous}::SDISelAsmOperandInfo&):
Assertion `I != RC->end() && "AssignedReg should be member of RC"' failed.

gcc 7.5 compiles it cleanly.

$ cat foo.c
typedef int __v8si __attribute__((__vector_size__(32)));
void foo(void) {
    /* This should be "ymm15" but gcc accepts while clang asserts. */
    register __v8si a asm("xmm15") = {
        0x1234001,
        0x1234002,
        0x1234003,
        0x1234004,
        0x1234005,
        0x1234006,
        0x1234007,
        0x1234008,
    };
    asm volatile ("traceme: call dummy" : : "x" (a));
}
$ gcc foo.c -c -mavx
$ clang foo.c -c -mavx
<crash>

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210106/9dc2b63b/attachment.html>


More information about the llvm-bugs mailing list