<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 - Assertion "cast<Ty>() argument of incompatible type!" in 'Unroll loops' pass"
href="https://bugs.llvm.org/show_bug.cgi?id=36302">36302</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Assertion "cast<Ty>() argument of incompatible type!" in 'Unroll loops' pass
</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>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>ilia.taraban@intel.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>This test fails at "Unroll loops" with "cast<Ty>() argument of incompatible
type!" :
================= nice.c ==============
unsigned int m = 0;
unsigned int a [192];
int main ()
{
unsigned int j = 0;
unsigned int i = 0;
for (i = 0; i <= 7; i++)
for (j = i; j > 1; j--) {
if (i == 96)
m++;
if (i == 0)
a[0] = j;
a[2 * j]++;
}
return 0;
}
=======================================
<span class="quote">>>> clang -v</span >
clang version 7.0.0 (trunk 324592)
Target: x86_64-unknown-linux-gnu
Thread model: posix
...
<span class="quote">>>> clang -c -O3 -march=skx nice.c</span >
clang-7.0: .../llvm/include/llvm/Support/Casting.h:255: typename
llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X = llvm::ConstantInt; Y
= llvm::Value; typename llvm::cast_retty<X, Y*>::ret_type =
llvm::ConstantInt*]: Assertion `isa<X>(Val) && "cast<Ty>() argument of
incompatible type!"' failed.
...
1. <eof> parser at end of file
2. Per-module optimization passes
3. Running pass 'Function Pass Manager' on module 'nice.c'.
4. Running pass 'Loop Pass Manager' on function '@main'
5. Running pass 'Unroll loops' on basic block '%vector.body'
This is a small ll reproducer for opt:
================= fine.ll =============
@a = external local_unnamed_addr global [4 x i64], align 16
; Function Attrs: norecurse nounwind uwtable
define void @main() local_unnamed_addr #0 {
entry:
br label %vector.body
vector.body: ; preds = %vector.body,
%entry
%vec.ind = phi <2 x i64> [ <i64 2, i64 1>, %entry ], [ undef, %vector.body ]
%0 = shl <2 x i64> %vec.ind, <i64 1, i64 1>
%1 = getelementptr inbounds [4 x i64], [4 x i64]* @a, i64 0, <2 x i64> %0
br i1 undef, label %middle.block, label %vector.body
middle.block: ; preds = %vector.body
unreachable
}
=======================================
<span class="quote">>>> opt -loop-unroll fine.ll</span >
opt: .../llvm/include/llvm/Support/Casting.h:255: typename llvm::cast_retty<X,
Y*>::ret_type llvm::cast(Y*) [with X = llvm::ConstantInt; Y = llvm::Value;
typename llvm::cast_retty<X, Y*>::ret_type = llvm::ConstantInt*]: Assertion
`isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
...
Stack dump:
0. Program arguments: opt -loop-unroll fine.ll
1. Running pass 'Function Pass Manager' on module 'fine.ll'.
2. Running pass 'Loop Pass Manager' on function '@main'
3. Running pass 'Unroll loops' on basic block '%vector.body'
Aborted (core dumped)</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>