<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 - [arm] After 186155b89c2d, fatal error: error in backend: Cannot select: t28: i32 = ARMISD::QADD8b t33, t35"
   href="https://bugs.llvm.org/show_bug.cgi?id=45677">45677</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[arm] After 186155b89c2d, fatal error: error in backend: Cannot select: t28: i32 = ARMISD::QADD8b t33, t35
          </td>
        </tr>

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

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

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

        <tr>
          <th>OS</th>
          <td>All
          </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>new bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>dimitry@andric.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Recently I got the following fatal backend error when building
<a href="https://github.com/freebsd/freebsd/blob/master/sys/dev/sound/pcm/feeder_mixer.c">https://github.com/freebsd/freebsd/blob/master/sys/dev/sound/pcm/feeder_mixer.c</a>
for armv5 (on FreeBSD this apparently defaults to -target-cpu arm1022e):

fatal error: error in backend: Cannot select: t37: i32 = ARMISD::QADD8b t43,
t44
  t43: i32,ch = load<(load 1 from %ir.8, !tbaa !65), sext from i8> t0, t5,
undef:i32
    t5: i32 = add t2, t4
      t2: i32,ch = CopyFromReg t0, Register:i32 %1
        t1: i32 = Register %1
      t4: i32,ch = CopyFromReg t0, Register:i32 %2
        t3: i32 = Register %2
    t14: i32 = undef
  t44: i32,ch = load<(load 1 from %ir.11, !tbaa !65), sext from i8> t0, t8,
undef:i32
    t8: i32 = add t7, t4
      t7: i32,ch = CopyFromReg t0, Register:i32 %0
        t6: i32 = Register %0
      t4: i32,ch = CopyFromReg t0, Register:i32 %2
        t3: i32 = Register %2
    t14: i32 = undef
In function: feed_mixer_S8NE

The full test case reduces to:

// clang -cc1 -triple armv5e--- -S -target-cpu arm1022e -O1 feeder_mixer-min.c
char *a;
char b;
int c;
void d() {
  int e, f = *(signed char *)a;
  c = *(signed char *)1;
  e = f + c;
  f = e > 127 ? 127 : e < -0x80 ? 128 : e;
  b = f;
}

Interestingly, this regressed with the *very* last Subversion commit to trunk,
<a href="https://reviews.llvm.org/rL375505">https://reviews.llvm.org/rL375505</a> ("[InstCombine] Signed saturation patterns"),
a.k.a. <a href="https://reviews.llvm.org/rG186155b89c2d">https://reviews.llvm.org/rG186155b89c2d</a>, and
<a href="https://reviews.llvm.org/D68651">https://reviews.llvm.org/D68651</a>.

It still reproduces with recent llvm master.</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>