<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 --- - crash at -O1 and above in 32-bit and 64-bit modes on x686_64-linux-gnu (`ICmp.getPredicate() == ICmpInst::ICMP_UGT && "ICmp should be folded!"')"
href="https://llvm.org/bugs/show_bug.cgi?id=28011">28011</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>crash at -O1 and above in 32-bit and 64-bit modes on x686_64-linux-gnu (`ICmp.getPredicate() == ICmpInst::ICMP_UGT && "ICmp should be folded!"')
</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>Windows NT
</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>chengniansun@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>$: clang-trunk -v
clang version 3.9.0 (trunk 271835)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5.3.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.2
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.3
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.3.0
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
$:
$: clang-trunk -O3 small.c
clang-3.9:
/tmp/llvm-builder/llvm-source-trunk/lib/Transforms/InstCombine/InstCombineCompares.cpp:2486:
llvm::Instruction*
llvm::InstCombiner::visitICmpInstWithCastAndCast(llvm::ICmpInst&): Assertion
`ICmp.getPredicate() == ICmpInst::ICMP_UGT && "ICmp should be folded!"' failed.
0 clang-3.9 0x0000000001c472a5
llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 37
1 clang-3.9 0x0000000001c45056 llvm::sys::RunSignalHandlers() + 54
2 clang-3.9 0x0000000001c45281
3 libpthread.so.0 0x00007f6369f76330
4 libc.so.6 0x00007f6369194c37 gsignal + 55
5 libc.so.6 0x00007f6369198028 abort + 328
6 libc.so.6 0x00007f636918dbf6
7 libc.so.6 0x00007f636918dca2
8 clang-3.9 0x00000000019b2f28
9 clang-3.9 0x00000000019c0c13
10 clang-3.9 0x0000000001985d6d
11 clang-3.9 0x00000000019869db
12 clang-3.9 0x0000000001986de2
llvm::InstructionCombiningPass::runOnFunction(llvm::Function&) + 690
13 clang-3.9 0x00000000018d7a33
llvm::FPPassManager::runOnFunction(llvm::Function&) + 643
14 clang-3.9 0x00000000018d7deb
llvm::FPPassManager::runOnModule(llvm::Module&) + 43
15 clang-3.9 0x00000000018d80ff
llvm::legacy::PassManagerImpl::run(llvm::Module&) + 751
16 clang-3.9 0x0000000001d7eaf8
clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions
const&, clang::TargetOptions const&, clang::LangOptions const&,
llvm::DataLayout const&, llvm::Module*, clang::BackendAction,
llvm::raw_pwrite_stream*) + 3640
17 clang-3.9 0x000000000239e886
18 clang-3.9 0x00000000026de59b clang::ParseAST(clang::Sema&, bool, bool)
+ 571
19 clang-3.9 0x000000000239ec4e clang::CodeGenAction::ExecuteAction() +
78
20 clang-3.9 0x0000000002081336 clang::FrontendAction::Execute() + 518
21 clang-3.9 0x000000000205c92e
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 318
22 clang-3.9 0x000000000210627c
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 2300
23 clang-3.9 0x0000000000a0d848 cc1_main(llvm::ArrayRef<char const*>,
char const*, void*) + 2296
24 clang-3.9 0x00000000009c0e28 main + 6456
25 libc.so.6 0x00007f636917ff45 __libc_start_main + 245
26 clang-3.9 0x0000000000a09804
Stack dump:
0. Program arguments: /usr/local/clang-trunk/bin/clang-3.9 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -disable-free -main-file-name small.c
-mrelocation-model static -mthread-model posix -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64
-momit-leaf-frame-pointer -dwarf-column-info -debugger-tuning=gdb -resource-dir
/usr/local/clang-trunk/bin/../lib/clang/3.9.0 -c-isystem . -c-isystem
/usr/local/include/csmith-2.2.0/ -c-isystem /usr/local/include/csmith-2.2.0/
-internal-isystem /usr/local/include -internal-isystem
/usr/local/clang-trunk/bin/../lib/clang/3.9.0/include -internal-externc-isystem
/usr/include/x86_64-linux-gnu -internal-externc-isystem /include
-internal-externc-isystem /usr/include -O3 -fdebug-compilation-dir
/home/cnsun/ramdisk/reduction/20160605-clang-trunk-m32-g-O3-build-141712/delta
-ferror-limit 19 -fmessage-length 132 -fobjc-runtime=gcc
-fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp
-o /tmp/small-ef55d7.o -x c small.c
1. <eof> parser at end of file
2. Per-module optimization passes
3. Running pass 'Function Pass Manager' on module 'small.c'.
4. Running pass 'Combine redundant instructions' on function '@main'
clang-3.9: error: unable to execute command: Aborted (core dumped)
clang-3.9: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.9.0 (trunk 271835)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
clang-3.9: note: diagnostic msg: PLEASE submit a bug report to
<a href="http://llvm.org/bugs/">http://llvm.org/bugs/</a> and include the crash backtrace, preprocessed source, and
associated run script.
clang-3.9: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-3.9: note: diagnostic msg: /tmp/small-cb9406.c
clang-3.9: note: diagnostic msg: /tmp/small-cb9406.sh
clang-3.9: note: diagnostic msg:
********************
$:
$: cat small.c
int **a;
int b[1];
int c;
short d;
int main() {
int ***e = &a;
c = d != (((int ***)b != e) | 1);
return 0;
}
$:</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>