[llvm-bugs] [Bug 48024] New: llvm-mca crashes with LDMXCSR and STMXCSR instructions in combination for some architectures.

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Oct 30 12:14:00 PDT 2020


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

            Bug ID: 48024
           Summary: llvm-mca crashes with LDMXCSR and STMXCSR instructions
                    in combination for some architectures.
           Product: new-bugs
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: ToHe_EMA at gmx.de
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org

The llvm-mca tool crashes with the following assembly for some architectures:

        stmxcsr dword ptr [rsp - 4]
        mov     eax, -24577
        and     eax, dword ptr [rsp - 4]
        mov     dword ptr [rsp - 8], eax
        ldmxcsr dword ptr [rsp - 8]
        ret

(Here is a Godbolt Compiler Explorer Link for it:
https://gcc.godbolt.org/z/adh57E)

The problem is present for at least Bulldozer, Piledriver, Haswell, Broadwell,
Silvermont and Goldmont architecture.

llvm-mca does not crash if only either the LDMXCSR or the STMXCSR instruction
is present but not both simultanously including the bitwise manipulation. The
problem does not occur either if one of Zen, Zen 2, Penryn, Westmere, Nehalem,
Sandy Bridge, Ivy Bridge, Skylake or Cannonlake is specified as the scheduling
model.

The error message is as follows:

PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash
backtrace.
Stack dump:
0.      Program arguments: /llvm-mca --mcpu=bdver2 <source> 
 #0 0x0000559cd340b0cc llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)
(/llvm-mca+0x6810cc)
 #1 0x0000559cd3408fa4 llvm::sys::RunSignalHandlers() (/llvm-mca+0x67efa4)
 #2 0x0000559cd3409113 SignalHandler(int) (/llvm-mca+0x67f113)
 #3 0x00007fcf53be23c0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x153c0)
 #4 0x0000559cd3317600 llvm::mca::LSUnit::dispatch(llvm::mca::InstRef const&)
(/llvm-mca+0x58d600)
 #5 0x0000559cd3320365 llvm::mca::Scheduler::dispatch(llvm::mca::InstRef&)
(/llvm-mca+0x596365)
 #6 0x0000559cd332cc6e llvm::mca::ExecuteStage::execute(llvm::mca::InstRef&)
(/llvm-mca+0x5a2c6e)
 #7 0x0000559cd332a71a llvm::mca::DispatchStage::dispatch(llvm::mca::InstRef)
(/llvm-mca+0x5a071a)
 #8 0x0000559cd332a769 llvm::mca::DispatchStage::execute(llvm::mca::InstRef&)
(.localalias.70) (/llvm-mca+0x5a0769)
 #9 0x0000559cd332b976 llvm::mca::EntryStage::execute(llvm::mca::InstRef&)
(.localalias.72) (/llvm-mca+0x5a1976)
#10 0x0000559cd332988c llvm::mca::Pipeline::runCycle() (/llvm-mca+0x59f88c)
#11 0x0000559cd3329a26 llvm::mca::Pipeline::run() (/llvm-mca+0x59fa26)
#12 0x0000559cd3047871 runPipeline(llvm::mca::Pipeline&) (/llvm-mca+0x2bd871)
#13 0x0000559cd303aa72 main (/llvm-mca+0x2b0a72)
#14 0x00007fcf5369b0b3 __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x270b3)
#15 0x0000559cd304413a _start (/llvm-mca+0x2ba13a)

-- 
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/20201030/a382675a/attachment.html>


More information about the llvm-bugs mailing list