<div dir="ltr"><div>Here is LLVM IR code:</div><a href="https://gist.github.com/andrewrk/041af662b3ff515cd0be64ab85c112d7">https://gist.github.com/andrewrk/041af662b3ff515cd0be64ab85c112d7</a><br><div><br></div><div>That produces the following valgrind message:</div><div><span style="color:rgb(51,51,51);font-family:consolas,"liberation mono",menlo,courier,monospace;font-size:12px;white-space:pre">$ valgrind llc -filetype=obj bug.ll </span><br></div><div><span style="color:rgb(51,51,51);font-family:consolas,"liberation mono",menlo,courier,monospace;font-size:12px;white-space:pre"><br></span></div><div><div>==27195== Conditional jump or move depends on uninitialised value(s)</div><div>==27195==    at 0x56A0917: (anonymous namespace)::LiveDebugValues::transferDebugValue(llvm::MachineInstr const&, (anonymous namespace)::LiveDebugValues::OpenRangesSet&, llvm::UniqueVector<(anonymous namespace)::LiveDebugValues::VarLoc>&) [clone .isra.207] (in /nix/store/06dpmfn74zrmman8nq8p96dg50lwbxhg-llvm-3.9.0-lib/lib/<a href="http://libLLVM-3.9.so">libLLVM-3.9.so</a>)</div><div>==27195==    by 0x56A3EE5: (anonymous namespace)::LiveDebugValues::ExtendRanges(llvm::MachineFunction&) [clone .constprop.259] (in /nix/store/06dpmfn74zrmman8nq8p96dg50lwbxhg-llvm-3.9.0-lib/lib/<a href="http://libLLVM-3.9.so">libLLVM-3.9.so</a>)</div><div>==27195==    by 0x57214A0: llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (in /nix/store/06dpmfn74zrmman8nq8p96dg50lwbxhg-llvm-3.9.0-lib/lib/<a href="http://libLLVM-3.9.so">libLLVM-3.9.so</a>)</div><div>==27195==    by 0x55CDF01: llvm::FPPassManager::runOnFunction(llvm::Function&) (in /nix/store/06dpmfn74zrmman8nq8p96dg50lwbxhg-llvm-3.9.0-lib/lib/<a href="http://libLLVM-3.9.so">libLLVM-3.9.so</a>)</div><div>==27195==    by 0x55CE29A: llvm::FPPassManager::runOnModule(llvm::Module&) (in /nix/store/06dpmfn74zrmman8nq8p96dg50lwbxhg-llvm-3.9.0-lib/lib/<a href="http://libLLVM-3.9.so">libLLVM-3.9.so</a>)</div><div>==27195==    by 0x55CDB4E: llvm::legacy::PassManagerImpl::run(llvm::Module&) (in /nix/store/06dpmfn74zrmman8nq8p96dg50lwbxhg-llvm-3.9.0-lib/lib/<a href="http://libLLVM-3.9.so">libLLVM-3.9.so</a>)</div><div>==27195==    by 0x41C0B7: compileModule(char**, llvm::LLVMContext&) [clone .constprop.385] (in /nix/store/jis8r9v01xz357h3b39sqym8rls3h6nj-llvm-3.9.0/bin/llc)</div><div>==27195==    by 0x412D3F: main (in /nix/store/jis8r9v01xz357h3b39sqym8rls3h6nj-llvm-3.9.0/bin/llc)</div><div><br></div></div><div>This is in llvm 3.9.0.</div><div><br></div><div>I found this while troubleshooting what I now to believe to be a separate issue in my frontend code that caused LLVM to go into an infinite loop writing into a .o file. When I ran that IR code against llc, I got "error: initializer with struct type has wrong # elements" which LLVMVerifyModule did not catch. I can provide this example IR as well if wanted.</div><div><br></div><div>Regards,</div><div>Andrew</div></div>