<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-mca crashes with LDMXCSR and STMXCSR instructions in combination for some architectures."
   href="https://bugs.llvm.org/show_bug.cgi?id=48024">48024</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>llvm-mca crashes with LDMXCSR and STMXCSR instructions in combination for some architectures.
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

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

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>ToHe_EMA@gmx.de
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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:
<a href="https://gcc.godbolt.org/z/adh57E">https://gcc.godbolt.org/z/adh57E</a>)

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 <a href="https://bugs.llvm.org/">https://bugs.llvm.org/</a> 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)</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>