<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Aug 4, 2016, at 11:27 AM, Abe Skolnik via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Dear sir,<br class=""><br class="">Thanks for your reply.  I apologize for taking a few days to reply.<br class=""><br class=""><br class=""><blockquote type="cite" class="">Crashed how?<br class=""></blockquote><br class="">Please see the below.<br class=""><br class=""><br class=""><blockquote type="cite" class="">Have you turned on ASan?<br class=""></blockquote><br class="">Not yet, but thanks for the suggestion.  I guess I will try to rebuild my modified Clang+LLVM with addr. san. and see what happens.<br class=""><br class=""><br class=""><blockquote type="cite" class=""> I recommend attaching a minimal reproduction...<br class=""></blockquote><br class="">Well, since I`m hacking on LLVM itself, this is not 100% trivial.  I will explain.<br class=""><br class="">The first hurdle I had to overcome was the fact that the "GlobalVariable" class had an explicitly-deleted copy ctor and no move ctor.  I dealt with this by writing a copy ctor; I`ll paste that in below.<br class=""><br class="">A perhaps-important point is that I don`t know _why_ the "GlobalVariable" class had an explicitly-deleted copy ctor and no move ctor.  As an experiment, I moved forward with the hypothesis that this was simply because neither was needed at the time and the default [i.e. compiler-inserted] copy ctor would have been wrong.  I hope the one _I_ wrote is _right_.  ;-)<br class=""><br class=""><br class=""><blockquote type="cite" class="">I assume you can reproduce this in a unit test?<br class=""></blockquote><br class="">Well, it doesn`t take a long program-under-compilation to make this fail.  As before, I will paste something in after my sign-off.<br class=""><br class=""><br class="">Regards,<br class=""><br class="">Abe<br class=""><br class=""><br class=""><br class=""><br class=""><br class="">----- added near the end of "OptimizeGlobalVars" in "llvm/lib/Transforms/IPO/GlobalOpt.cpp", amongst many other things I added to that routine -----<br class=""><br class="">struct GV_alignment_comparator {<br class="">   bool operator()(const GlobalVariable& L, const GlobalVariable& R) {<br class="">     return L.getAlignment() < R.getAlignment();<br class="">   }<br class="">};<br class=""><br class="">if (unsorted) {<br class="">   M.getGlobalList().sort( GV_alignment_comparator() );<br class=""></div></div></blockquote><div><br class=""></div><div><br class=""></div><div>The issue is that the “sort” method of iplist is delegating a bunch of things to SymbolTableListTraits, and the later makes some assumption that are broken in this case.</div><div>The offending path is:</div><div><br class=""></div><div>1) iplist:sort() wANTS to split the list in two</div><div>2) it creates a new empty list, and tries to splice a subpart of the existing list into the new one:</div><div><br class=""></div><div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">    </span><span style="font-variant-ligatures: no-common-ligatures" class="">// Split the list into two.</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">    </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">iplist</span><span style="font-variant-ligatures: no-common-ligatures" class=""> RightHalf;</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">    RightHalf.splice(RightHalf.begin(), *</span><span style="font-variant-ligatures: no-common-ligatures; color: #ba2da2" class="">this</span><span style="font-variant-ligatures: no-common-ligatures" class="">, Center, end());</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div></div><div>3) split will call back into: SymbolTableListTraits::transferNodesFromList. Unfortunately this assumes that the list is owned by a Module (see <span class="Apple-tab-span" style="white-space:pre">  </span>SymbolTableListTraits ::<span style="font-family: Menlo; font-size: 11px;" class="">getListOwner())</span></div><div><br class=""></div><div>This obviously breaks badly in this case.</div><div><br class=""></div><div>Note: I don’t know why you needed a copy/move ctor for global value, I was able to build with your “patch” to GlobalOpt.cpp without changing anything else.</div><div><br class=""></div><div>— </div><div>Mehdi</div><div><br class=""></div><div><br class=""></div><div><br class=""></div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div class="">   Changed = true;<br class="">}<br class=""><br class=""><br class=""><br class="">----- added to "llvm/lib/IR/Globals.cpp" [and commented out the relevant deletion in "llvm/include/llvm/IR/GlobalVariable.h"] -----<br class=""><br class="">GlobalVariable::GlobalVariable(const GlobalVariable& GV) : GlobalVariable( GV.getValueType(), GV.isConstant(), GV.getLinkage() ) { // copy ctor<br class="">   copyAttributesFrom(&GV);<br class="">}<br class=""><br class=""><br class=""><br class=""><br class=""><br class="">main_with_3_globals.c<br class="">---------------------<br class=""><br class="">int  foo;<br class="">char bar;<br class="">long baz;<br class=""><br class="">int main(){return foo;}<br class=""><br class=""><br class=""><br class=""><br class=""><br class=""><br class=""><br class=""><br class=""><br class=""><br class="">----- error dump from compiler driver -----<br class=""><br class=""><blockquote type="cite" class="">../build_003/bin/clang main_with_3_globals.c -O3<br class=""></blockquote><br class="">Abe was here: max. profitable alignment: 16<br class=""><br class="">Abe was here: found a global value that DOES have a name [“foo”],<br class="">   with alignment 4,<br class="">   no named section [double-check: should be empty string: “”],<br class="">   which is a pointer to a NON-array<br class="">   and with pointee type getTypeStoreSize -> 4<br class=""><br class="">Abe was here: found a global value that DOES have a name [“bar”],<br class="">   with alignment 1,<br class="">   no named section [double-check: should be empty string: “”],<br class="">   which is a pointer to a NON-array<br class="">   and with pointee type getTypeStoreSize -> 1<br class=""><br class="">Abe was here: found a global value that DOES have a name [“baz”],<br class="">   with alignment 8,<br class="">   no named section [double-check: should be empty string: “”],<br class="">   which is a pointer to a NON-array<br class="">   and with pointee type getTypeStoreSize -> 8<br class=""><br class="">===== Abe was here: the globals above are NOT in ascending-alignment order. =====<br class="">0  clang-3.9       0x0000000002853ebc llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 60<br class="">1  clang-3.9       0x00000000028543a9<br class="">2  clang-3.9       0x0000000002852a83 llvm::sys::RunSignalHandlers() + 131<br class="">3  clang-3.9       0x00000000028546f4<br class="">4  libpthread.so.0 0x00007fc595318330<br class="">5  clang-3.9       0x00000000027fbe12 llvm::StringMapImpl::LookupBucketFor(llvm::StringRef) + 466<br class="">6  clang-3.9       0x0000000002320fa4<br class="">7  clang-3.9       0x0000000002320a10 llvm::ValueSymbolTable::reinsertValue(llvm::Value*) + 112<br class="">8  clang-3.9       0x00000000022f0551 llvm::SymbolTableListTraits<llvm::GlobalVariable>::transferNodesFromList(llvm::SymbolTableListTraits<llvm::GlobalVariable>&, llvm::ilist_iterator<llvm::GlobalVariable>, llvm::ilist_iterator<llvm::GlobalVariable>) + 273<br class="">9  clang-3.9       0x00000000023b1fd9<br class="">10 clang-3.9       0x00000000023b1c45<br class="">11 clang-3.9       0x00000000023a8e40<br class="">12 clang-3.9       0x000000000239e77c<br class="">13 clang-3.9       0x000000000239d88e<br class="">14 clang-3.9       0x00000000023a9f8c<br class="">15 clang-3.9       0x00000000022ac02a<br class="">16 clang-3.9       0x00000000022abb56 llvm::legacy::PassManagerImpl::run(llvm::Module&) + 342<br class="">17 clang-3.9       0x00000000022ac541 llvm::legacy::PassManager::run(llvm::Module&) + 33<br class="">18 clang-3.9       0x0000000002adf7c5<br class="">19 clang-3.9       0x0000000002adeda6 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout const&, llvm::Module*, clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >) + 150<br class="">20 clang-3.9       0x00000000035d622f<br class="">21 clang-3.9       0x0000000004259504 clang::ParseAST(clang::Sema&, bool, bool) + 820<br class="">22 clang-3.9       0x00000000030f011a clang::ASTFrontendAction::ExecuteAction() + 314<br class="">23 clang-3.9       0x00000000035d4bf5 clang::CodeGenAction::ExecuteAction() + 2357<br class="">24 clang-3.9       0x00000000030efc00 clang::FrontendAction::Execute() + 112<br class="">25 clang-3.9       0x0000000003094c81 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 1025<br class="">26 clang-3.9       0x0000000003241ba1 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1473<br class="">27 clang-3.9       0x0000000000c33bc8 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) + 920<br class="">28 clang-3.9       0x0000000000c27c2a<br class="">29 clang-3.9       0x0000000000c26ae2 main + 2642<br class="">30 libc.so.6       0x00007fc593e80f45 __libc_start_main + 245<br class="">31 clang-3.9       0x0000000000c25f44<br class="">Stack dump:<br class="">0.      Program arguments: /work/Abe/non-backup-worthy/build_dirs/Clang/pre-3.9/2016-07-17-22-54-42-1cb1a4c-master/build_003/bin/clang-3.9 -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -disable-free -main-file-name main_with_3_globals.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 /work/Abe/non-backup-worthy/build_dirs/Clang/pre-3.9/2016-07-17-22-54-42-1cb1a4c-master/build_003/bin/../lib/clang/3.9.0 -internal-isystem /usr/local/include -internal-isystem /work/Abe/non-backup-worthy/build_dirs/Clang/pre-3.9/2016-07-17-22-54-42-1cb1a4c-master/build_003/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 /work/Abe/non-backup-worthy/build_dirs/Clang/pre-3.9/2016-07-17-22-54-42-1cb1a4c-master/tmp -ferror-limit 19 -fmessage-length 144 -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp -o /tmp/main_with_3_globals-cef92e.o -x c main_with_3_globals.c<br class="">1.      <eof> parser at end of file<br class="">2.      Per-module optimization passes<br class="">3.      Running pass 'Global Variable Optimizer' on module 'main_with_3_globals.c'.<br class="">clang-3.9: error: unable to execute command: Segmentation fault<br class="">clang-3.9: error: clang frontend command failed due to signal (use -v to see invocation)<br class="">clang version 3.9.0<br class="">Target: x86_64-unknown-linux-gnu<br class="">Thread model: posix<br class="">InstalledDir: /work/Abe/non-backup-worthy/build_dirs/Clang/pre-3.9/2016-07-17-22-54-42-1cb1a4c-master/tmp/../build_003/bin<br class="">clang-3.9: note: diagnostic msg: PLEASE submit a bug report to <a href="http://llvm.org/bugs/" class="">http://llvm.org/bugs/</a> and include the crash backtrace, preprocessed source, and associated run script.<br class="">clang-3.9: note: diagnostic msg:<br class="">********************<br class=""><br class="">PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:<br class="">Preprocessed source(s) and associated run script(s) are located at:<br class="">clang-3.9: note: diagnostic msg: /tmp/main_with_3_globals-841619.c<br class="">clang-3.9: note: diagnostic msg: /tmp/main_with_3_globals-841619.sh<br class="">clang-3.9: note: diagnostic msg:<br class=""><br class="">********************<br class=""><br class=""><br class=""><br class=""><br class="">GDB backtrace from the "-cc1" part of another run of the same-as-the-preceding compilation attempt<br class="">--------------------------------------------------------------------------------------------------<br class=""><br class="">Program received signal SIGSEGV, Segmentation fault.<br class="">0x00000000027fbe12 in llvm::StringMapImpl::LookupBucketFor (this=0x82f00e8, Name=...)<br class="">     at /work/Abe/non-backup-worthy/build_dirs/Clang/pre-3.9/2016-07-17-22-54-42-1cb1a4c-master/llvm/lib/Support/StringMap.cpp:102<br class="">102         } else if (LLVM_LIKELY(HashTable[BucketNo] == FullHashValue)) {<br class="">(gdb) bt<br class="">#0  0x00000000027fbe12 in llvm::StringMapImpl::LookupBucketFor (this=0x82f00e8, Name=...)<br class="">     at /work/Abe/non-backup-worthy/build_dirs/Clang/pre-3.9/2016-07-17-22-54-42-1cb1a4c-master/llvm/lib/Support/StringMap.cpp:102<br class="">#1  0x0000000002320fa4 in llvm::StringMap<llvm::Value*, llvm::MallocAllocator>::insert (this=0x82f00e8, KeyValue=0x8312cb0)<br class="">     at /work/Abe/non-backup-worthy/build_dirs/Clang/pre-3.9/2016-07-17-22-54-42-1cb1a4c-master/llvm/include/llvm/ADT/StringMap.h:345<br class="">#2  0x0000000002320a10 in llvm::ValueSymbolTable::reinsertValue (this=0x82f00e8, V=0x830cfd8)<br class="">     at /work/Abe/non-backup-worthy/build_dirs/Clang/pre-3.9/2016-07-17-22-54-42-1cb1a4c-master/llvm/lib/IR/ValueSymbolTable.cpp:59<br class="">#3  0x00000000022f0551 in llvm::SymbolTableListTraits<llvm::GlobalVariable>::transferNodesFromList (this=0x7fffffffabd8, L2=..., first=...,<br class="">     last=...)<br class="">     at /work/Abe/non-backup-worthy/build_dirs/Clang/pre-3.9/2016-07-17-22-54-42-1cb1a4c-master/llvm/lib/IR/SymbolTableListTraitsImpl.h:102<br class="">#4  0x00000000023b1fd9 in llvm::iplist<llvm::GlobalVariable, llvm::SymbolTableListTraits<llvm::GlobalVariable> >::transfer (<br class="">     this=0x7fffffffabd8, position=..., L2=..., first=..., last=...)<br class="">     at /work/Abe/non-backup-worthy/build_dirs/Clang/pre-3.9/2016-07-17-22-54-42-1cb1a4c-master/llvm/include/llvm/ADT/ilist.h:532<br class="">#5  0x00000000023b1c45 in llvm::iplist<llvm::GlobalVariable, llvm::SymbolTableListTraits<llvm::GlobalVariable> >::splice (this=0x7fffffffabd8,<br class="">     where=..., L2=..., first=..., last=...)<br class="">     at /work/Abe/non-backup-worthy/build_dirs/Clang/pre-3.9/2016-07-17-22-54-42-1cb1a4c-master/llvm/include/llvm/ADT/ilist.h:587<br class="">#6  0x00000000023a8e40 in llvm::iplist<llvm::GlobalVariable, llvm::SymbolTableListTraits<llvm::GlobalVariable> >::sort<OptimizeGlobalVars(llvm::Module&, llvm::TargetLibraryInfo*, llvm::function_ref<llvm::DominatorTree& (llvm::Function&)>, llvm::SmallSet<llvm::Comdat const*, 8u, std::less<llvm::Comdat const*> >&)::GV_alignment_comparator>(OptimizeGlobalVars(llvm::Module&, llvm::TargetLibraryInfo*, llvm::function_ref<llvm::DominatorTree& (llvm::Function&)>, llvm::SmallSet<llvm::Comdat const*, 8u, std::less<llvm::Comdat const*> >&)::GV_alignment_comparator) (<br class="">     this=0x82b1f98, comp=...)<br class="">     at /work/Abe/non-backup-worthy/build_dirs/Clang/pre-3.9/2016-07-17-22-54-42-1cb1a4c-master/llvm/include/llvm/ADT/ilist.h:632<br class="">#7  0x000000000239e77c in OptimizeGlobalVars(llvm::Module&, llvm::TargetLibraryInfo*, llvm::function_ref<llvm::DominatorTree& (llvm::Function&)>, llvm::SmallSet<llvm::Comdat const*, 8u, std::less<llvm::Comdat const*> >&) (M=..., TLI=0x8293860, LookupDomTree=...,<br class="">     NotDiscardableComdats=...)<br class="">     at /work/Abe/non-backup-worthy/build_dirs/Clang/pre-3.9/2016-07-17-22-54-42-1cb1a4c-master/llvm/lib/Transforms/IPO/GlobalOpt.cpp:2199<br class="">#8  0x000000000239d88e in optimizeGlobalsInModule(llvm::Module&, llvm::DataLayout const&, llvm::TargetLibraryInfo*, llvm::function_ref<llvm::DominatorTree& (llvm::Function&)>) (M=..., DL=..., TLI=0x8293860, LookupDomTree=...)<br class="">     at /work/Abe/non-backup-worthy/build_dirs/Clang/pre-3.9/2016-07-17-22-54-42-1cb1a4c-master/llvm/lib/Transforms/IPO/GlobalOpt.cpp:2655<br class="">#9  0x00000000023a9f8c in (anonymous namespace)::GlobalOptLegacyPass::runOnModule (this=0x8294f10, M=...)<br class="">     at /work/Abe/non-backup-worthy/build_dirs/Clang/pre-3.9/2016-07-17-22-54-42-1cb1a4c-master/llvm/lib/Transforms/IPO/GlobalOpt.cpp:2705<br class="">#10 0x00000000022ac02a in (anonymous namespace)::MPPassManager::runOnModule (this=0x831de40, M=...)<br class="">     at /work/Abe/non-backup-worthy/build_dirs/Clang/pre-3.9/2016-07-17-22-54-42-1cb1a4c-master/llvm/lib/IR/LegacyPassManager.cpp:1603<br class="">#11 0x00000000022abb56 in llvm::legacy::PassManagerImpl::run (this=0x83237d0, M=...)<br class="">     at /work/Abe/non-backup-worthy/build_dirs/Clang/pre-3.9/2016-07-17-22-54-42-1cb1a4c-master/llvm/lib/IR/LegacyPassManager.cpp:1706<br class="">#12 0x00000000022ac541 in llvm::legacy::PassManager::run (this=0x7fffffffb500, M=...)<br class="">     at /work/Abe/non-backup-worthy/build_dirs/Clang/pre-3.9/2016-07-17-22-54-42-1cb1a4c-master/llvm/lib/IR/LegacyPassManager.cpp:1737<br class="">#13 0x0000000002adf7c5 in (anonymous namespace)::EmitAssemblyHelper::EmitAssembly (this=0x7fffffffb7a8, Action=clang::Backend_EmitObj, OS=...)<br class="">     at /work/Abe/non-backup-worthy/build_dirs/Clang/pre-3.9/2016-07-17-22-54-42-1cb1a4c-master/llvm/tools/cfe/lib/CodeGen/BackendUtil.cpp:734<br class="">#14 0x0000000002adeda6 in clang::EmitBackendOutput (Diags=..., CGOpts=..., TOpts=..., LOpts=..., TDesc=..., M=0x82b1f90,<br class="">     Action=clang::Backend_EmitObj, OS=...)<br class="">     at /work/Abe/non-backup-worthy/build_dirs/Clang/pre-3.9/2016-07-17-22-54-42-1cb1a4c-master/llvm/tools/cfe/lib/CodeGen/BackendUtil.cpp:751<br class="">#15 0x00000000035d622f in clang::BackendConsumer::HandleTranslationUnit (this=0x82b1a80, C=...)<br class="">     at /work/Abe/non-backup-worthy/build_dirs/Clang/pre-3.9/2016-07-17-22-54-42-1cb1a4c-master/llvm/tools/cfe/lib/CodeGen/CodeGenAction.cpp:179<br class="">#16 0x0000000004259504 in clang::ParseAST (S=..., PrintStats=false, SkipFunctionBodies=false)<br class="">     at /work/Abe/non-backup-worthy/build_dirs/Clang/pre-3.9/2016-07-17-22-54-42-1cb1a4c-master/llvm/tools/cfe/lib/Parse/ParseAST.cpp:167<br class="">#17 0x00000000030f011a in clang::ASTFrontendAction::ExecuteAction (this=0x8297f20)<br class="">     at /work/Abe/non-backup-worthy/build_dirs/Clang/pre-3.9/2016-07-17-22-54-42-1cb1a4c-master/llvm/tools/cfe/lib/Frontend/FrontendAction.cpp:556<br class="">#18 0x00000000035d4bf5 in clang::CodeGenAction::ExecuteAction (this=0x8297f20)<br class="">     at /work/Abe/non-backup-worthy/build_dirs/Clang/pre-3.9/2016-07-17-22-54-42-1cb1a4c-master/llvm/tools/cfe/lib/CodeGen/CodeGenAction.cpp:853<br class="">#19 0x00000000030efc00 in clang::FrontendAction::Execute (this=0x8297f20)<br class="">     at /work/Abe/non-backup-worthy/build_dirs/Clang/pre-3.9/2016-07-17-22-54-42-1cb1a4c-master/llvm/tools/cfe/lib/Frontend/FrontendAction.cpp:457<br class="">#20 0x0000000003094c81 in clang::CompilerInstance::ExecuteAction (this=0x827df40, Act=...)<br class="">     at /work/Abe/non-backup-worthy/build_dirs/Clang/pre-3.9/2016-07-17-22-54-42-1cb1a4c-master/llvm/tools/cfe/lib/Frontend/CompilerInstance.cpp:867<br class="">#21 0x0000000003241ba1 in clang::ExecuteCompilerInvocation (Clang=0x827df40)<br class="">     at /work/Abe/non-backup-worthy/build_dirs/Clang/pre-3.9/2016-07-17-22-54-42-1cb1a4c-master/llvm/tools/cfe/lib/FrontendTool/ExecuteCompilerInvocation.cpp:241<br class="">#22 0x0000000000c33bc8 in cc1_main (Argv=...,<br class="">     Argv0=0x7fffffffe3f9 "/work/Abe/non-backup-worthy/build_dirs/Clang/pre-3.9/2016-07-17-22-54-42-1cb1a4c-master/tmp/clang",<br class="">     MainAddr=0xc26010 <GetExecutablePath(char const*, bool)>)<br class="">     at /work/Abe/non-backup-worthy/build_dirs/Clang/pre-3.9/2016-07-17-22-54-42-1cb1a4c-master/llvm/tools/cfe/tools/driver/cc1_main.cpp:116<br class="">#23 0x0000000000c27c2a in ExecuteCC1Tool (argv=..., Tool=...)<br class="">     at /work/Abe/non-backup-worthy/build_dirs/Clang/pre-3.9/2016-07-17-22-54-42-1cb1a4c-master/llvm/tools/cfe/tools/driver/driver.cpp:301<br class="">#24 0x0000000000c26ae2 in main (argc_=52, argv_=0x7fffffffdfb8)<br class="">     at /work/Abe/non-backup-worthy/build_dirs/Clang/pre-3.9/2016-07-17-22-54-42-1cb1a4c-master/llvm/tools/cfe/tools/driver/driver.cpp:382<br class=""><br class=""><br class=""><br class=""><br class=""><br class=""><br class=""><br class=""><br class="">----- /tmp/main_with_3_globals-841619.c -----<br class=""><br class=""># 1 "<built-in>"<br class=""># 1 "main_with_3_globals.c"<br class="">int  foo;<br class="">char bar;<br class="">long baz;<br class=""><br class="">int main(){return foo;}<br class=""><br class=""><br class=""><br class="">----- /tmp/main_with_3_globals-841619.sh -----<br class=""><br class=""># Crash reproducer for clang version 3.9.0<br class=""># Driver args: "main_with_3_globals.c" "-O3"<br class=""># Original command: "/work/Abe/non-backup-worthy/build_dirs/Clang/pre-3.9/2016-07-17-22-54-42-1cb1a4c-master/build_003/bin/clang-3.9" "-cc1" "-triple" "x86_64-unknown-linux-gnu" "-emit-obj" "-disable-free" "-main-file-name" "main_with_3_globals.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" "/work/Abe/non-backup-worthy/build_dirs/Clang/pre-3.9/2016-07-17-22-54-42-1cb1a4c-master/build_003/bin/../lib/clang/3.9.0" "-internal-isystem" "/usr/local/include" "-internal-isystem" "/work/Abe/non-backup-worthy/build_dirs/Clang/pre-3.9/2016-07-17-22-54-42-1cb1a4c-master/build_003/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" "/work/Abe/non-backup-worthy/build_dirs/Clang/pre-3.9/2016-07-17-22-54-42-1cb1a4c-master/tmp" "-ferror-limit" "19" "-fmessage-length" "144" "-fobjc-runtime=gcc" "-fdiagnostics-show-option" "-fcolor-diagnostics" "-vectorize-loops" "-vectorize-slp" "-o" "/tmp/main_with_3_globals-cef92e.o" "-x" "c" "main_with_3_globals.c"<br class="">"/work/Abe/non-backup-worthy/build_dirs/Clang/pre-3.9/2016-07-17-22-54-42-1cb1a4c-master/build_003/bin/clang-3.9" "-cc1" "-triple" "x86_64-unknown-linux-gnu" "-emit-obj" "-disable-free" "-main-file-name" "main_with_3_globals.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" "-O3" "-ferror-limit" "19" "-fmessage-length" "144" "-fobjc-runtime=gcc" "-fdiagnostics-show-option" "-fcolor-diagnostics" "-vectorize-loops" "-vectorize-slp" "-x" "c" "main_with_3_globals-841619.c"<br class=""><br class=""><br class=""><br class=""><br class=""><br class=""><br class="">[the previous 3 sections, i.e. error dump + preprocessed C code + shell code: much the same with an AArch64 target, using "-target aarch64-gnu-linux" and containing the output line "Target: aarch64--linux-gnu"]<br class="">_______________________________________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<br class=""></div></div></blockquote></div><br class=""></body></html>