<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 - x32 Cannot emit physreg copy instruction"
   href="https://bugs.llvm.org/show_bug.cgi?id=51672">51672</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>x32 Cannot emit physreg copy instruction
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>12.0
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>Linux
          </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: X86
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>uko.koknevics@zimperium.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>craig.topper@gmail.com, llvm-bugs@lists.llvm.org, llvm-dev@redking.me.uk, pengfei.wang@intel.com, spatel+llvm@rotateright.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=25199" name="attach_25199" title="minified .bc file">attachment 25199</a> <a href="attachment.cgi?id=25199&action=edit" title="minified .bc file">[details]</a></span>
minified .bc file

`llc --mtriple=x86_64-linux-gnux32 bugpoint-reduced-simplified.bc` fails. 

Compiling for `x86_64-linux-gnu`, `i386-linux-gnu`, `aarch64-linux-gnu` works
fine, didn't test on any other targets.

Failed with Debian bullseye's llvm 11.0.1 (1:11.0-51+nmu5), custom-built
versions from 11.0.0 to 12.0.1.  (Stack trace is from Debian's llvm as the
custom-built ones aren't built with all the symbols.)

The `.bc` file was generated by `clang++ -O2 -mx32 -c main.cpp -emit-llvm` and
then minified with `bugpoint` as per instructions.  `g++ -O2 -mx32` (Debian
bullseye 4:10.2.1-1) compiles the same `main.cpp` file with no issues.

Stack dump:
0.      Program arguments: llc --mtriple=x86_64-linux-gnux32
bugpoint-reduced-simplified.bc
1.      Running pass 'Function Pass Manager' on module
'bugpoint-reduced-simplified.bc'.
2.      Running pass 'Post-RA pseudo instruction expansion pass' on function
'@_Z1bv'
 #0 0x00007f9c75dfaf8f llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/usr/lib/x86_64-linux-gnu/libLLVM-11.so.1+0xbd0f8f)
 #1 0x00007f9c75df92f0 llvm::sys::RunSignalHandlers()
(/usr/lib/x86_64-linux-gnu/libLLVM-11.so.1+0xbcf2f0)
 #2 0x00007f9c75dfb465 (/usr/lib/x86_64-linux-gnu/libLLVM-11.so.1+0xbd1465)
 #3 0x00007f9c7521c140 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x14140)
 #4 0x00007f9c74d53ce1 raise ./signal/../sysdeps/unix/sysv/linux/raise.c:51:1
 #5 0x00007f9c74d3d537 abort ./stdlib/abort.c:81:7
 #6 0x00007f9c75d4ad68 (/usr/lib/x86_64-linux-gnu/libLLVM-11.so.1+0xb20d68)
 #7 0x00007f9c75d4ab88 (/usr/lib/x86_64-linux-gnu/libLLVM-11.so.1+0xb20b88)
 #8 0x00007f9c77f38bad (/usr/lib/x86_64-linux-gnu/libLLVM-11.so.1+0x2d0ebad)
 #9 0x00007f9c75ff73bf (/usr/lib/x86_64-linux-gnu/libLLVM-11.so.1+0xdcd3bf)
#10 0x00007f9c760ce1ae
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
(/usr/lib/x86_64-linux-gnu/libLLVM-11.so.1+0xea41ae)
#11 0x00007f9c75f0a059 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/usr/lib/x86_64-linux-gnu/libLLVM-11.so.1+0xce0059)
#12 0x00007f9c75f0f603 llvm::FPPassManager::runOnModule(llvm::Module&)
(/usr/lib/x86_64-linux-gnu/libLLVM-11.so.1+0xce5603)
#13 0x00007f9c75f0a670 llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/usr/lib/x86_64-linux-gnu/libLLVM-11.so.1+0xce0670)
#14 0x000000000040e0df main (/usr/lib/llvm-11/bin/llc+0x40e0df)
#15 0x00007f9c74d3ed0a __libc_start_main ./csu/../csu/libc-start.c:308:16
#16 0x000000000040ba2a _start (/usr/lib/llvm-11/bin/llc+0x40ba2a)
Aborted</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>