<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </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 --- - fatal error: error in backend: Cannot select: 0x2d59140: ch = brind 0x2d54d00:1, 0x2d54d00 [ORD=1] [ID=10]" href="https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_bugs_show-5Fbug.cgi-3Fid-3D23665&d=AwMBaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=7pu0L1e9d1KMD4x_EMAivvQsgxIyeNGZfcV7EbM3JRo&s=Vf5Vma99pkehZt7pFKdU0i0fVqU4ZILwUwzPhO_hCD4&e=">23665</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>fatal error: error in backend: Cannot select: 0x2d59140: ch = brind 0x2d54d00:1, 0x2d54d00 [ORD=1] [ID=10]
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </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>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>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>bero@linaro.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=14387" name="attach_14387" title="preprocessed source">attachment 14387</a> <a href="attachment.cgi?id=14387&action=edit" title="preprocessed source">[details]</a></span>
preprocessed source

This will be a little hard to reproduce because so far I only see it with a
patched llvm/clang, but I'm pretty sure the error is merely exposed, not
caused, by the patches.

This happens while building musl for an x32 target:

fatal error: error in backend: Cannot select: 0x2d59140: ch = brind
0x2d54d00:1, 0x2d54d00 [ORD=1] [ID=10]
  0x2d54d00: i32,ch = load 0x2d58000:1, 0x2d557b0, 0x2d58130<LD4[JumpTable]>
[ORD=1] [ID=9]
    0x2d557b0: i32 = add 0x2d57550, 0x2d55090 [ORD=1] [ID=8]
      0x2d57550: i32 = shl 0x2d58000, 0x2d58260 [ORD=1] [ID=7]
        0x2d58000: i32,ch = CopyFromReg 0x2ccfae0, 0x2d55550 [ORD=1] [ID=5]
          0x2d55550: i32 = Register %vreg43 [ID=1]
        0x2d58260: i8 = Constant<2> [ID=4]
      0x2d55090: i32 = X86ISD::Wrapper 0x2d58db0 [ID=6]
        0x2d58db0: i32 = TargetJumpTable<0> [ID=3]
    0x2d58130: i32 = undef [ID=2]
In function: sysconf
clang: error: clang frontend command failed with exit code 70 (use -v to see
invocation)
clang version 3.7.0 (trunk)
Target: x86_64-openmandriva-linux-muslx32
Thread model: posix
clang: note: diagnostic msg: PLEASE submit a bug report to
<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_bugs_&d=AwMBaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=7pu0L1e9d1KMD4x_EMAivvQsgxIyeNGZfcV7EbM3JRo&s=dbrDe2heXwrQO2tcrSvLkE0sI7Fek9KnAwhGxBxzEvg&e=">http://llvm.org/bugs/</a> and include the crash backtrace, preprocessed source, and
associated run script.


The patches I'm applying essentially just teach clang about the musl libc
(different dynamic linker path etc.) and teach it to recognize the "-muslx32"
suffix in the target as "Use musl libc and x32 ABI".</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>