<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Aug 4, 2016 at 11:27 AM, Abe Skolnik via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear sir,<br>
<br>
Thanks for your reply.  I apologize for taking a few days to reply.<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Crashed how?<br>
</blockquote>
<br>
Please see the below.<span class=""><br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Have you turned on ASan?<br>
</blockquote>
<br></span>
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.<span class=""><br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
 I recommend attaching a minimal reproduction...<br>
</blockquote>
<br></span>
Well, since I`m hacking on LLVM itself, this is not 100% trivial.  I will explain.<br>
<br>
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>
<br>
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_.  ;-)</blockquote><div><br></div><div>You should never be copying or moving around Values.  An llvm::Value (which GlobalVariable is a subtype of) should exist only in the heap.  We play games where use lists are allocated before the object which will not work at all with stack based allocations.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I assume you can reproduce this in a unit test?<br>
</blockquote>
<br></span>
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>
<br>
<br>
Regards,<br>
<br>
Abe<br>
<br>
<br>
<br>
<br>
<br>
----- added near the end of "OptimizeGlobalVars" in "llvm/lib/Transforms/IPO/Globa<wbr>lOpt.cpp", amongst many other things I added to that routine -----<span class=""><br>
<br>
struct GV_alignment_comparator {<br>
   bool operator()(const GlobalVariable& L, const GlobalVariable& R) {<br>
     return L.getAlignment() < R.getAlignment();<br>
   }<br>
};<br>
<br></span>
if (unsorted) {<span class=""><br>
   M.getGlobalList().sort( GV_alignment_comparator() );<br>
   Changed = true;<br>
}<br>
<br>
<br>
<br></span>
----- added to "llvm/lib/IR/Globals.cpp" [and commented out the relevant deletion in "llvm/include/llvm/IR/GlobalVa<wbr>riable.h"] -----<br>
<br>
GlobalVariable::GlobalVariable<wbr>(const GlobalVariable& GV) : GlobalVariable( GV.getValueType(), GV.isConstant(), GV.getLinkage() ) { // copy ctor<br>
   copyAttributesFrom(&GV);<br>
}<br>
<br>
<br>
<br>
<br>
<br>
main_with_3_globals.c<br>
---------------------<br>
<br>
int  foo;<br>
char bar;<br>
long baz;<br>
<br>
int main(){return foo;}<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
----- error dump from compiler driver -----<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
../build_003/bin/clang main_with_3_globals.c -O3<br>
</blockquote>
<br>
Abe was here: max. profitable alignment: 16<br>
<br>
Abe was here: found a global value that DOES have a name [“foo”],<br>
   with alignment 4,<br>
   no named section [double-check: should be empty string: “”],<br>
   which is a pointer to a NON-array<br>
   and with pointee type getTypeStoreSize -> 4<br>
<br>
Abe was here: found a global value that DOES have a name [“bar”],<br>
   with alignment 1,<br>
   no named section [double-check: should be empty string: “”],<br>
   which is a pointer to a NON-array<br>
   and with pointee type getTypeStoreSize -> 1<br>
<br>
Abe was here: found a global value that DOES have a name [“baz”],<br>
   with alignment 8,<br>
   no named section [double-check: should be empty string: “”],<br>
   which is a pointer to a NON-array<br>
   and with pointee type getTypeStoreSize -> 8<br>
<br>
===== Abe was here: the globals above are NOT in ascending-alignment order. =====<br>
0  clang-3.9       0x0000000002853ebc llvm::sys::PrintStackTrace(llv<wbr>m::raw_ostream&) + 60<br>
1  clang-3.9       0x00000000028543a9<br>
2  clang-3.9       0x0000000002852a83 llvm::sys::RunSignalHandlers() + 131<br>
3  clang-3.9       0x00000000028546f4<br>
4  libpthread.so.0 0x00007fc595318330<br>
5  clang-3.9       0x00000000027fbe12 llvm::StringMapImpl::LookupBuc<wbr>ketFor(llvm::StringRef) + 466<br>
6  clang-3.9       0x0000000002320fa4<br>
7  clang-3.9       0x0000000002320a10 llvm::ValueSymbolTable::reinse<wbr>rtValue(llvm::Value*) + 112<br>
8  clang-3.9       0x00000000022f0551 llvm::SymbolTableListTraits<ll<wbr>vm::GlobalVariable>::transferN<wbr>odesFromList(llvm::SymbolTable<wbr>ListTraits<llvm::GlobalVariabl<wbr>e>&, llvm::ilist_iterator<llvm::Glo<wbr>balVariable>, llvm::ilist_iterator<llvm::Glo<wbr>balVariable>) + 273<br>
9  clang-3.9       0x00000000023b1fd9<br>
10 clang-3.9       0x00000000023b1c45<br>
11 clang-3.9       0x00000000023a8e40<br>
12 clang-3.9       0x000000000239e77c<br>
13 clang-3.9       0x000000000239d88e<br>
14 clang-3.9       0x00000000023a9f8c<br>
15 clang-3.9       0x00000000022ac02a<br>
16 clang-3.9       0x00000000022abb56 llvm::legacy::PassManagerImpl:<wbr>:run(llvm::Module&) + 342<br>
17 clang-3.9       0x00000000022ac541 llvm::legacy::PassManager::run<wbr>(llvm::Module&) + 33<br>
18 clang-3.9       0x0000000002adf7c5<br>
19 clang-3.9       0x0000000002adeda6 clang::EmitBackendOutput(clang<wbr>::DiagnosticsEngine&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout const&, llvm::Module*, clang::BackendAction, std::unique_ptr<llvm::raw_pwri<wbr>te_stream, std::default_delete<llvm::raw_<wbr>pwrite_stream> >) + 150<br>
20 clang-3.9       0x00000000035d622f<br>
21 clang-3.9       0x0000000004259504 clang::ParseAST(clang::Sema&, bool, bool) + 820<br>
22 clang-3.9       0x00000000030f011a clang::ASTFrontendAction::Exec<wbr>uteAction() + 314<br>
23 clang-3.9       0x00000000035d4bf5 clang::CodeGenAction::ExecuteA<wbr>ction() + 2357<br>
24 clang-3.9       0x00000000030efc00 clang::FrontendAction::Execute<wbr>() + 112<br>
25 clang-3.9       0x0000000003094c81 clang::CompilerInstance::Execu<wbr>teAction(clang::FrontendAction<wbr>&) + 1025<br>
26 clang-3.9       0x0000000003241ba1 clang::ExecuteCompilerInvocati<wbr>on(clang::CompilerInstance*) + 1473<br>
27 clang-3.9       0x0000000000c33bc8 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) + 920<br>
28 clang-3.9       0x0000000000c27c2a<br>
29 clang-3.9       0x0000000000c26ae2 main + 2642<br>
30 libc.so.6       0x00007fc593e80f45 __libc_start_main + 245<br>
31 clang-3.9       0x0000000000c25f44<br>
Stack dump:<br>
0.      Program arguments: /work/Abe/non-backup-worthy/bu<wbr>ild_dirs/Clang/pre-3.9/2016-07<wbr>-17-22-54-42-1cb1a4c-master/bu<wbr>ild_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/bu<wbr>ild_dirs/Clang/pre-3.9/2016-07<wbr>-17-22-54-42-1cb1a4c-master/bu<wbr>ild_003/bin/../lib/clang/3.9.0 -internal-isystem /usr/local/include -internal-isystem /work/Abe/non-backup-worthy/bu<wbr>ild_dirs/Clang/pre-3.9/2016-07<wbr>-17-22-54-42-1cb1a4c-master/bu<wbr>ild_003/bin/../lib/clang/3.9.<wbr>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/bu<wbr>ild_dirs/Clang/pre-3.9/2016-07<wbr>-17-22-54-42-1cb1a4c-master/tm<wbr>p -ferror-limit 19 -fmessage-length 144 -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp -o /tmp/main_with_3_globals-cef92<wbr>e.o -x c main_with_3_globals.c<br>
1.      <eof> parser at end of file<br>
2.      Per-module optimization passes<br>
3.      Running pass 'Global Variable Optimizer' on module 'main_with_3_globals.c'.<br>
clang-3.9: error: unable to execute command: Segmentation fault<br>
clang-3.9: error: clang frontend command failed due to signal (use -v to see invocation)<br>
clang version 3.9.0<br>
Target: x86_64-unknown-linux-gnu<br>
Thread model: posix<br>
InstalledDir: /work/Abe/non-backup-worthy/bu<wbr>ild_dirs/Clang/pre-3.9/2016-07<wbr>-17-22-54-42-1cb1a4c-master/tm<wbr>p/../build_003/bin<br>
clang-3.9: note: diagnostic msg: PLEASE submit a bug report to <a href="http://llvm.org/bugs/" rel="noreferrer" target="_blank">http://llvm.org/bugs/</a> and include the crash backtrace, preprocessed source, and associated run script.<br>
clang-3.9: note: diagnostic msg:<br>
********************<br>
<br>
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:<br>
Preprocessed source(s) and associated run script(s) are located at:<br>
clang-3.9: note: diagnostic msg: /tmp/main_with_3_globals-84161<wbr>9.c<br>
clang-3.9: note: diagnostic msg: /tmp/main_with_3_globals-84161<wbr>9.sh<br>
clang-3.9: note: diagnostic msg:<br>
<br>
********************<br>
<br>
<br>
<br>
<br>
GDB backtrace from the "-cc1" part of another run of the same-as-the-preceding compilation attempt<br>
------------------------------<wbr>------------------------------<wbr>------------------------------<wbr>--------<br>
<br>
Program received signal SIGSEGV, Segmentation fault.<br>
0x00000000027fbe12 in llvm::StringMapImpl::LookupBuc<wbr>ketFor (this=0x82f00e8, Name=...)<br>
     at /work/Abe/non-backup-worthy/bu<wbr>ild_dirs/Clang/pre-3.9/2016-07<wbr>-17-22-54-42-1cb1a4c-master/ll<wbr>vm/lib/Support/StringMap.cpp:<wbr>102<br>
102         } else if (LLVM_LIKELY(HashTable[BucketN<wbr>o] == FullHashValue)) {<br>
(gdb) bt<br>
#0  0x00000000027fbe12 in llvm::StringMapImpl::LookupBuc<wbr>ketFor (this=0x82f00e8, Name=...)<br>
     at /work/Abe/non-backup-worthy/bu<wbr>ild_dirs/Clang/pre-3.9/2016-07<wbr>-17-22-54-42-1cb1a4c-master/ll<wbr>vm/lib/Support/StringMap.cpp:<wbr>102<br>
#1  0x0000000002320fa4 in llvm::StringMap<llvm::Value*, llvm::MallocAllocator>::insert (this=0x82f00e8, KeyValue=0x8312cb0)<br>
     at /work/Abe/non-backup-worthy/bu<wbr>ild_dirs/Clang/pre-3.9/2016-07<wbr>-17-22-54-42-1cb1a4c-master/ll<wbr>vm/include/llvm/ADT/StringMap.<wbr>h:345<br>
#2  0x0000000002320a10 in llvm::ValueSymbolTable::reinse<wbr>rtValue (this=0x82f00e8, V=0x830cfd8)<br>
     at /work/Abe/non-backup-worthy/bu<wbr>ild_dirs/Clang/pre-3.9/2016-07<wbr>-17-22-54-42-1cb1a4c-master/ll<wbr>vm/lib/IR/ValueSymbolTable.cpp<wbr>:59<br>
#3  0x00000000022f0551 in llvm::SymbolTableListTraits<ll<wbr>vm::GlobalVariable>::transferN<wbr>odesFromList (this=0x7fffffffabd8, L2=..., first=...,<br>
     last=...)<br>
     at /work/Abe/non-backup-worthy/bu<wbr>ild_dirs/Clang/pre-3.9/2016-07<wbr>-17-22-54-42-1cb1a4c-master/ll<wbr>vm/lib/IR/SymbolTableListTrait<wbr>sImpl.h:102<br>
#4  0x00000000023b1fd9 in llvm::iplist<llvm::GlobalVaria<wbr>ble, llvm::SymbolTableListTraits<ll<wbr>vm::GlobalVariable> >::transfer (<br>
     this=0x7fffffffabd8, position=..., L2=..., first=..., last=...)<br>
     at /work/Abe/non-backup-worthy/bu<wbr>ild_dirs/Clang/pre-3.9/2016-07<wbr>-17-22-54-42-1cb1a4c-master/ll<wbr>vm/include/llvm/ADT/ilist.h:53<wbr>2<br>
#5  0x00000000023b1c45 in llvm::iplist<llvm::GlobalVaria<wbr>ble, llvm::SymbolTableListTraits<ll<wbr>vm::GlobalVariable> >::splice (this=0x7fffffffabd8,<br>
     where=..., L2=..., first=..., last=...)<br>
     at /work/Abe/non-backup-worthy/bu<wbr>ild_dirs/Clang/pre-3.9/2016-07<wbr>-17-22-54-42-1cb1a4c-master/ll<wbr>vm/include/llvm/ADT/ilist.h:58<wbr>7<br>
#6  0x00000000023a8e40 in llvm::iplist<llvm::GlobalVaria<wbr>ble, llvm::SymbolTableListTraits<ll<wbr>vm::GlobalVariable> >::sort<OptimizeGlobalVars(llv<wbr>m::Module&, llvm::TargetLibraryInfo*, llvm::function_ref<llvm::Domin<wbr>atorTree& (llvm::Function&)>, llvm::SmallSet<llvm::Comdat const*, 8u, std::less<llvm::Comdat const*> >&)::GV_alignment_comparator>(<wbr>OptimizeGlobalVars(llvm::Modul<wbr>e&, llvm::TargetLibraryInfo*, llvm::function_ref<llvm::Domin<wbr>atorTree& (llvm::Function&)>, llvm::SmallSet<llvm::Comdat const*, 8u, std::less<llvm::Comdat const*> >&)::GV_alignment_comparator) (<br>
     this=0x82b1f98, comp=...)<br>
     at /work/Abe/non-backup-worthy/bu<wbr>ild_dirs/Clang/pre-3.9/2016-07<wbr>-17-22-54-42-1cb1a4c-master/ll<wbr>vm/include/llvm/ADT/ilist.h:63<wbr>2<br>
#7  0x000000000239e77c in OptimizeGlobalVars(llvm::Modul<wbr>e&, llvm::TargetLibraryInfo*, llvm::function_ref<llvm::Domin<wbr>atorTree& (llvm::Function&)>, llvm::SmallSet<llvm::Comdat const*, 8u, std::less<llvm::Comdat const*> >&) (M=..., TLI=0x8293860, LookupDomTree=...,<br>
     NotDiscardableComdats=...)<br>
     at /work/Abe/non-backup-worthy/bu<wbr>ild_dirs/Clang/pre-3.9/2016-07<wbr>-17-22-54-42-1cb1a4c-master/ll<wbr>vm/lib/Transforms/IPO/GlobalOp<wbr>t.cpp:2199<br>
#8  0x000000000239d88e in optimizeGlobalsInModule(llvm::<wbr>Module&, llvm::DataLayout const&, llvm::TargetLibraryInfo*, llvm::function_ref<llvm::Domin<wbr>atorTree& (llvm::Function&)>) (M=..., DL=..., TLI=0x8293860, LookupDomTree=...)<br>
     at /work/Abe/non-backup-worthy/bu<wbr>ild_dirs/Clang/pre-3.9/2016-07<wbr>-17-22-54-42-1cb1a4c-master/ll<wbr>vm/lib/Transforms/IPO/GlobalOp<wbr>t.cpp:2655<br>
#9  0x00000000023a9f8c in (anonymous namespace)::GlobalOptLegacyPas<wbr>s::runOnModule (this=0x8294f10, M=...)<br>
     at /work/Abe/non-backup-worthy/bu<wbr>ild_dirs/Clang/pre-3.9/2016-07<wbr>-17-22-54-42-1cb1a4c-master/ll<wbr>vm/lib/Transforms/IPO/GlobalOp<wbr>t.cpp:2705<br>
#10 0x00000000022ac02a in (anonymous namespace)::MPPassManager::run<wbr>OnModule (this=0x831de40, M=...)<br>
     at /work/Abe/non-backup-worthy/bu<wbr>ild_dirs/Clang/pre-3.9/2016-07<wbr>-17-22-54-42-1cb1a4c-master/ll<wbr>vm/lib/IR/LegacyPassManager.cp<wbr>p:1603<br>
#11 0x00000000022abb56 in llvm::legacy::PassManagerImpl:<wbr>:run (this=0x83237d0, M=...)<br>
     at /work/Abe/non-backup-worthy/bu<wbr>ild_dirs/Clang/pre-3.9/2016-07<wbr>-17-22-54-42-1cb1a4c-master/ll<wbr>vm/lib/IR/LegacyPassManager.cp<wbr>p:1706<br>
#12 0x00000000022ac541 in llvm::legacy::PassManager::run (this=0x7fffffffb500, M=...)<br>
     at /work/Abe/non-backup-worthy/bu<wbr>ild_dirs/Clang/pre-3.9/2016-07<wbr>-17-22-54-42-1cb1a4c-master/ll<wbr>vm/lib/IR/LegacyPassManager.cp<wbr>p:1737<br>
#13 0x0000000002adf7c5 in (anonymous namespace)::EmitAssemblyHelper<wbr>::EmitAssembly (this=0x7fffffffb7a8, Action=clang::Backend_EmitObj, OS=...)<br>
     at /work/Abe/non-backup-worthy/bu<wbr>ild_dirs/Clang/pre-3.9/2016-07<wbr>-17-22-54-42-1cb1a4c-master/ll<wbr>vm/tools/cfe/lib/CodeGen/Backe<wbr>ndUtil.cpp:734<br>
#14 0x0000000002adeda6 in clang::EmitBackendOutput (Diags=..., CGOpts=..., TOpts=..., LOpts=..., TDesc=..., M=0x82b1f90,<br>
     Action=clang::Backend_<wbr>EmitObj, OS=...)<br>
     at /work/Abe/non-backup-worthy/bu<wbr>ild_dirs/Clang/pre-3.9/2016-07<wbr>-17-22-54-42-1cb1a4c-master/ll<wbr>vm/tools/cfe/lib/CodeGen/Backe<wbr>ndUtil.cpp:751<br>
#15 0x00000000035d622f in clang::BackendConsumer::Handle<wbr>TranslationUnit (this=0x82b1a80, C=...)<br>
     at /work/Abe/non-backup-worthy/bu<wbr>ild_dirs/Clang/pre-3.9/2016-07<wbr>-17-22-54-42-1cb1a4c-master/ll<wbr>vm/tools/cfe/lib/CodeGen/CodeG<wbr>enAction.cpp:179<br>
#16 0x0000000004259504 in clang::ParseAST (S=..., PrintStats=false, SkipFunctionBodies=false)<br>
     at /work/Abe/non-backup-worthy/bu<wbr>ild_dirs/Clang/pre-3.9/2016-07<wbr>-17-22-54-42-1cb1a4c-master/ll<wbr>vm/tools/cfe/lib/Parse/ParseAS<wbr>T.cpp:167<br>
#17 0x00000000030f011a in clang::ASTFrontendAction::Exec<wbr>uteAction (this=0x8297f20)<br>
     at /work/Abe/non-backup-worthy/bu<wbr>ild_dirs/Clang/pre-3.9/2016-07<wbr>-17-22-54-42-1cb1a4c-master/ll<wbr>vm/tools/cfe/lib/Frontend/Fron<wbr>tendAction.cpp:556<br>
#18 0x00000000035d4bf5 in clang::CodeGenAction::ExecuteA<wbr>ction (this=0x8297f20)<br>
     at /work/Abe/non-backup-worthy/bu<wbr>ild_dirs/Clang/pre-3.9/2016-07<wbr>-17-22-54-42-1cb1a4c-master/ll<wbr>vm/tools/cfe/lib/CodeGen/CodeG<wbr>enAction.cpp:853<br>
#19 0x00000000030efc00 in clang::FrontendAction::Execute (this=0x8297f20)<br>
     at /work/Abe/non-backup-worthy/bu<wbr>ild_dirs/Clang/pre-3.9/2016-07<wbr>-17-22-54-42-1cb1a4c-master/ll<wbr>vm/tools/cfe/lib/Frontend/Fron<wbr>tendAction.cpp:457<br>
#20 0x0000000003094c81 in clang::CompilerInstance::Execu<wbr>teAction (this=0x827df40, Act=...)<br>
     at /work/Abe/non-backup-worthy/bu<wbr>ild_dirs/Clang/pre-3.9/2016-07<wbr>-17-22-54-42-1cb1a4c-master/ll<wbr>vm/tools/cfe/lib/Frontend/Comp<wbr>ilerInstance.cpp:867<br>
#21 0x0000000003241ba1 in clang::ExecuteCompilerInvocati<wbr>on (Clang=0x827df40)<br>
     at /work/Abe/non-backup-worthy/bu<wbr>ild_dirs/Clang/pre-3.9/2016-07<wbr>-17-22-54-42-1cb1a4c-master/ll<wbr>vm/tools/cfe/lib/FrontendTool/<wbr>ExecuteCompilerInvocation.cpp:<wbr>241<br>
#22 0x0000000000c33bc8 in cc1_main (Argv=...,<br>
     Argv0=0x7fffffffe3f9 "/work/Abe/non-backup-worthy/b<wbr>uild_dirs/Clang/pre-3.9/2016-0<wbr>7-17-22-54-42-1cb1a4c-master/t<wbr>mp/clang",<br>
     MainAddr=0xc26010 <GetExecutablePath(char const*, bool)>)<br>
     at /work/Abe/non-backup-worthy/bu<wbr>ild_dirs/Clang/pre-3.9/2016-07<wbr>-17-22-54-42-1cb1a4c-master/ll<wbr>vm/tools/cfe/tools/driver/cc1_<wbr>main.cpp:116<br>
#23 0x0000000000c27c2a in ExecuteCC1Tool (argv=..., Tool=...)<br>
     at /work/Abe/non-backup-worthy/bu<wbr>ild_dirs/Clang/pre-3.9/2016-07<wbr>-17-22-54-42-1cb1a4c-master/ll<wbr>vm/tools/cfe/tools/driver/driv<wbr>er.cpp:301<br>
#24 0x0000000000c26ae2 in main (argc_=52, argv_=0x7fffffffdfb8)<br>
     at /work/Abe/non-backup-worthy/bu<wbr>ild_dirs/Clang/pre-3.9/2016-07<wbr>-17-22-54-42-1cb1a4c-master/ll<wbr>vm/tools/cfe/tools/driver/driv<wbr>er.cpp:382<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
----- /tmp/main_with_3_globals-84161<wbr>9.c -----<br>
<br>
# 1 "<built-in>"<br>
# 1 "main_with_3_globals.c"<br>
int  foo;<br>
char bar;<br>
long baz;<br>
<br>
int main(){return foo;}<br>
<br>
<br>
<br>
----- /tmp/main_with_3_globals-84161<wbr>9.sh -----<br>
<br>
# Crash reproducer for clang version 3.9.0<br>
# Driver args: "main_with_3_globals.c" "-O3"<br>
# Original command: "/work/Abe/non-backup-worthy/b<wbr>uild_dirs/Clang/pre-3.9/2016-0<wbr>7-17-22-54-42-1cb1a4c-master/b<wbr>uild_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/b<wbr>uild_dirs/Clang/pre-3.9/2016-0<wbr>7-17-22-54-42-1cb1a4c-master/b<wbr>uild_003/bin/../lib/clang/3.9.<wbr>0" "-internal-isystem" "/usr/local/include" "-internal-isystem" "/work/Abe/non-backup-worthy/b<wbr>uild_dirs/Clang/pre-3.9/2016-0<wbr>7-17-22-54-42-1cb1a4c-master/b<wbr>uild_003/bin/../lib/clang/3.9.<wbr>0/include" "-internal-externc-isystem" "/usr/include/x86_64-linux-gnu<wbr>" "-internal-externc-isystem" "/include" "-internal-externc-isystem" "/usr/include" "-O3" "-fdebug-compilation-dir" "/work/Abe/non-backup-worthy/b<wbr>uild_dirs/Clang/pre-3.9/2016-0<wbr>7-17-22-54-42-1cb1a4c-master/t<wbr>mp" "-ferror-limit" "19" "-fmessage-length" "144" "-fobjc-runtime=gcc" "-fdiagnostics-show-option" "-fcolor-diagnostics" "-vectorize-loops" "-vectorize-slp" "-o" "/tmp/main_with_3_globals-cef9<wbr>2e.o" "-x" "c" "main_with_3_globals.c"<br>
<br>
"/work/Abe/non-backup-worthy/b<wbr>uild_dirs/Clang/pre-3.9/2016-0<wbr>7-17-22-54-42-1cb1a4c-master/b<wbr>uild_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>
<br>
<br>
<br>
<br>
<br>
<br>
[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"]<div class="HOEnZb"><div class="h5"><br>
______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
</div></div></blockquote></div><br></div></div>