<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 --- - [AArch64] llc crashes with assertion "Illegal shifted immedate value!" on AArch64."
   href="https://llvm.org/bugs/show_bug.cgi?id=23591">23591</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[AArch64] llc crashes with assertion "Illegal shifted immedate value!" on AArch64.
          </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>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>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>kevinqindev@gmail.com
          </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>$cat test.ll

define i64 @test(i64 %h, i64 %l, i64 %d) {
entry:
  %h.addr = alloca i64, align 8
  %l.addr = alloca i64, align 8
  %d.addr = alloca i64, align 8
  store i64 %h, i64* %h.addr, align 8
  store i64 %l, i64* %l.addr, align 8
  store i64 %d, i64* %d.addr, align 8
  %0 = load i64, i64* %h.addr, align 8
  %shl = shl i64 %0, 64
  %1 = load i64, i64* %l.addr, align 8
  %or = or i64 %shl, %1
  %2 = load i64, i64* %d.addr, align 8
  %div = udiv i64 %or, %2
  ret i64 %div
}

$llc small.ll -O0 -o small.o -mtriple aarch64
llc:
/home/kevin/llvm_trunk/llvm/lib/Target/AArch64/MCTargetDesc/AArch64AddressingModes.h:100:
unsigned int llvm::AArch64_AM::getShifterImm(AArch64_AM::ShiftExtendType,
unsigned int): Assertion `(Imm & 0x3f) == Imm && "Illegal shifted immedate
value!"' failed.



The equivalent C is,

$cat test.c

unsigned long test(unsigned long h, unsigned long l, unsigned long d)
 {
 return((unsigned long)(((((unsigned long long)h)<<64)|l)/(unsigned long
long)d));
 }

$clang -target aarch64-linux-gnu -O0 small.c -S
clang-3.7:
/home/kevin/llvm_trunk/llvm/lib/Target/AArch64/MCTargetDesc/AArch64AddressingModes.h:100:
unsigned int llvm::AArch64_AM::getShifterImm(AArch64_AM::ShiftExtendType,
unsigned int): Assertion `(Imm & 0x3f) == Imm && "Illegal shifted immedate
value!"' failed.</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>