Source code that seg fault when compiled with clang

Hi all,

When I try to compile (with command line : "clang simple.ll -o exec") the llvm ir file in attachment, I get a seg fault. My machine is linux (ubuntu 16.04) machine with an intel i7 and 16gb of ram.

I got the following error report :

warning: overriding the module target triple with x86_64-pc-linux-gnu [-Woverride-module]
0 0x00007fa1d9183d38 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 56
1 0x00007fa1d9181fc6 llvm::sys::RunSignalHandlers() + 54
2 0x00007fa1d9182129
3        0x00007fa1d82be4b0
4 0x00007fa1d92a6c39 llvm::PHINode::removeIncomingValue(unsigned int, bool) + 73
5 0x00007fa1d91a4847 llvm::BasicBlock::removePredecessor(llvm::BasicBlock*, bool) + 487
6 0x00007fa1d951e152
7 0x00007fa1d92c92a2 llvm::FPPassManager::runOnFunction(llvm::Function&) + 498
8 0x00007fa1d92c963b llvm::FPPassManager::runOnModule(llvm::Module&) + 43
9 0x00007fa1d92c8eef llvm::legacy::PassManagerImpl::run(llvm::Module&) + 783
10 clang            0x00000000006eb0d3 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::raw_pwrite_stream*) + 4403
11 clang            0x0000000000a16e71
12 clang            0x000000000099aa0e clang::FrontendAction::Execute() + 302
13 clang            0x0000000000970406 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 278
14 clang            0x0000000000a152b3 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1987
15 clang            0x00000000006b3528 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) + 2264
16 clang            0x00000000006affbc main + 6252
17        0x00007fa1d82a9830 __libc_start_main + 240
18 clang            0x00000000006b1969 _start + 41
Stack dump:
0.	Program arguments: /usr/lib/llvm-3.8/bin/clang -cc1 -triple x86_64-pc-linux-gnu -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name simple.ll -mrelocation-model static -mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -dwarf-column-info -debugger-tuning=gdb -resource-dir /usr/lib/llvm-3.8/bin/../lib/clang/3.8.0 -fdebug-compilation-dir /home/nico/testCompiler -ferror-limit 19 -fmessage-length 134 -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -o /tmp/simple-b4ad3b.o -x ir simple.ll 
1.	Code generation
2.	Running pass 'Function Pass Manager' on module 'simple.ll'.
3.	Running pass 'Remove unreachable blocks from the CFG' on function '@simple'
clang: error: unable to execute command: Segmentation fault (core dumped)
clang: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
clang: note: diagnostic msg: PLEASE submit a bug report to []( and include the crash backtrace, preprocessed source, and associated run script.
clang: note: diagnostic msg: Error generating preprocessed source(s) - no preprocessable inputs.

Anybody have an idea of the problem ?




simple.ll (2.92 KB)