<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class="">Hi Steve,<br class=""><br class="">I had a quick look and with the help of creduce I was able to reproduce this with <a href="https://reviews.llvm.org/P8041" class="">https://reviews.llvm.org/P8041</a><br class=""><br class="">It looks like this is already fixed upstream and in the swift-4.1-branch. <br class=""><br class="">Cheers,<br class="">Jonas<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Oct 4, 2017, at 9:40 AM, mats petersson via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" class="">cfe-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class=""><div class="">The size of the source is not in itself indicative of the overall complexity [or simplicity, as I believe large basic-blocks is the main culprit due to something along the lines of "for each instruction I in BB { for each instruction J (except I) in BB { do something } }"] - it's easy to produce long sequences with for example a simple macro that repeats some code.<br class=""><br class=""></div>However, 40 minutes is rather a long time, so I'd say you probably have a hang.<br class=""><br class="">--<br class=""></div>Mats<br class=""></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On 3 October 2017 at 20:22, Steven Peters <span dir="ltr" class=""><<a href="mailto:scpeters@openrobotics.org" target="_blank" class="">scpeters@openrobotics.org</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class=""><div class=""><div class="">Mats,<br class=""><br class=""></div>That's a good point. I can't prove it's an infinite loop. Compiling with `-O1` or `-march=native` allows it to complete in less than 0.2 seconds with an object file size of 12 kB. I just tested the problematic case again and let it go for 40 minutes before I stopped it. I'll try running it a little longer on a computer I don't need to use, but it's not guaranteed to fix it I guess.<br class=""><br class="">It's tough to instrospect without debug symbols in the compiler toolchain.<br class=""><br class=""></div>Steve<br class=""></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br class=""><div class="gmail_quote">On Tue, Oct 3, 2017 at 3:17 AM, mats petersson <span dir="ltr" class=""><<a href="mailto:mats@planetcatfish.com" target="_blank" class="">mats@planetcatfish.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class=""><div class=""><div class="">Are you absolutely sure it hangs, and not just "taking a very long time"? I've hit the O(n^2) type problem with instruction selection, so if you have some code that produces very long basic-blocks, it could take ages to compile them - and the call-stack in that case will look very much like the one you posted.<br class=""><br class=""></div>I'm not saying you that your case isn't a genuine bug, I'm just asking so that the "right" problem is reported.<br class=""><br class="">--<br class=""></div><div class="">Mats<br class=""></div></div><div class="m_1428356291649310723HOEnZb"><div class="m_1428356291649310723h5"><div class="gmail_extra"><br class=""><div class="gmail_quote">On 2 October 2017 at 21:03, Steven Peters via cfe-dev <span dir="ltr" class=""><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank" class="">cfe-dev@lists.llvm.org</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="">Thanks for the idea. It looks like another infinite loop in DAG Combine (like <a href="http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20140421/213744.html" target="_blank" class="">r206873</a> and <a href="https://reviews.llvm.org/D26605" target="_blank" class="">D26605</a>) when I compile that file with -O2 and for the core2 target cpu. Is there any advice on introspecting SelectionDAG? I'm not sure how to identify which part of the source code is triggering the infinite loop.<br class=""><div class=""><br class=""></div><div class="">example stacktrace:<br class=""></div><div class="">~~~<br class="">(lldb) thread backtrace all<br class="">* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP<br class="">  * frame #0: 0x00000001079c39d1 clang`llvm::SelectionDAG::Comb<wbr class="">ine(llvm::CombineLevel, llvm::AAResults&, llvm::CodeGenOpt::Level) + 1441<br class="">    frame #1: 0x00000001079c242e clang`llvm::SelectionDAGISel::<wbr class="">CodeGenAndEmitDAG() + 974<br class="">    frame #2: 0x000000010790f726 clang`llvm::SelectionDAGISel::<wbr class="">SelectAllBasicBlocks(llvm::Fun<wbr class="">ction const&) + 6118<br class="">    frame #3: 0x0000000107907846 clang`llvm::SelectionDAGISel::<wbr class="">runOnMachineFunction(llvm::Mac<wbr class="">hineFunction&) + 998<br class="">    frame #4: 0x000000010829cd54 clang`(anonymous namespace)::X86DAGToDAGISel::r<wbr class="">unOnMachineFunction(llvm::Mach<wbr class="">ineFunction&) + 20<br class="">    frame #5: 0x000000010790590d clang`llvm::MachineFunctionPas<wbr class="">s::runOnFunction(llvm::Functio<wbr class="">n&) + 125<br class="">    frame #6: 0x00000001078c2562 clang`llvm::FPPassManager::run<wbr class="">OnFunction(llvm::Function&) + 498<br class="">    frame #7: 0x00000001078eb943 clang`llvm::FPPassManager::run<wbr class="">OnModule(llvm::Module&) + 67<br class="">    frame #8: 0x00000001078c67f5 clang`llvm::legacy::PassManage<wbr class="">rImpl::run(llvm::Module&) + 693<br class="">    frame #9: 0x000000010789e09c clang`clang::EmitBackendOutput<wbr class="">(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout const&, llvm::Module*, clang::BackendAction, std::__1::unique_ptr<llvm::raw<wbr class="">_pwrite_stream, std::__1::default_delete<llvm:<wbr class="">:raw_pwrite_stream> >) + 2700<br class="">    frame #10: 0x000000010786f00a clang`clang::BackendConsumer::<wbr class="">HandleTranslationUnit(clang::A<wbr class="">STContext&) + 410<br class="">    frame #11: 0x000000010754b249 clang`clang::ParseAST(clang::S<wbr class="">ema&, bool, bool) + 249<br class="">    frame #12: 0x00000001075482bc clang`clang::FrontendAction::E<wbr class="">xecute() + 44<br class="">    frame #13: 0x00000001074fe666 clang`clang::CompilerInstance:<wbr class="">:ExecuteAction(clang::Frontend<wbr class="">Action&) + 294<br class="">    frame #14: 0x00000001074fc7b9 clang`clang::ExecuteCompilerIn<wbr class="">vocation(clang::CompilerInstan<wbr class="">ce*) + 2329<br class="">    frame #15: 0x00000001074c6974 clang`cc1_main(llvm::ArrayRef<<wbr class="">char const*>, char const*, void*) + 1492<br class="">    frame #16: 0x00000001074c24ac clang`main + 13820<br class="">    frame #17: 0x00007fff6206b145 libdyld.dylib`start + 1<br class="">    frame #18: 0x00007fff6206b145 libdyld.dylib`start + 1<br class="">~~~<br class=""></div><div class=""><br class=""></div><div class="">Regards,<br class=""></div><div class="">Steve<br class=""></div></div><div class="m_1428356291649310723m_-2916037794177904119HOEnZb"><div class="m_1428356291649310723m_-2916037794177904119h5"><div class="gmail_extra"><br class=""><div class="gmail_quote">On Fri, Sep 29, 2017 at 12:57 AM, Csaba Raduly <span dir="ltr" class=""><<a href="mailto:rcsaba@gmail.com" target="_blank" class="">rcsaba@gmail.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Steven,<br class="">
<br class="">
If the compiler hangs, try to attach the debugger (gdb --pid). You<br class="">
should be able to get a stack trace, which would carry more<br class="">
information.<br class="">
<div class=""><div class="m_1428356291649310723m_-2916037794177904119m_-5986231835790600778h5"><br class="">
On Thu, Sep 28, 2017 at 10:03 PM, Steven Peters via cfe-dev<br class="">
<<a href="mailto:cfe-dev@lists.llvm.org" target="_blank" class="">cfe-dev@lists.llvm.org</a>> wrote:<br class="">
> Hello,<br class="">
><br class="">
> I've been digging into a compilation problem using the version of clang<br class="">
> distrubuted with XCode 9 on macOS High Sierra. I narrowed the problem down<br class="">
> to the transition from `-O1` to `-O2` for a target cpu of core2, and then I<br class="">
> further narrowed it down to the `-vectorize-loops` option for clang. The<br class="">
> challenge is that this problem manifests with clang failing to terminate. I<br class="">
> don't know if it's a deadlock or getting stuck in an infinite loop, but I<br class="">
> didn't see any guidance in the support documents about how to submit a bug<br class="">
> report in a case like this.<br class="">
><br class="">
> Current discussion of the compilation failure:<br class="">
> <a href="https://github.com/bulletphysics/bullet3/issues/1347" rel="noreferrer" target="_blank" class="">https://github.com/bulletphysi<wbr class="">cs/bullet3/issues/1347</a><br class="">
><br class="">
> ~~~<br class="">
> $ cc --version<br class="">
> Apple LLVM version 9.0.0 (clang-900.0.37)<br class="">
> Target: x86_64-apple-darwin17.0.0<br class="">
> Thread model: posix<br class="">
> InstalledDir: /Library/Developer/CommandLine<wbr class="">Tools/usr/bin<br class="">
> ~~~<br class="">
><br class="">
> Thanks for your time.<br class="">
><br class="">
> Regards,<br class="">
> Steve Peters<br class="">
><br class="">
><br class="">
</div></div>> ______________________________<wbr class="">_________________<br class="">
> cfe-dev mailing list<br class="">
> <a href="mailto:cfe-dev@lists.llvm.org" target="_blank" class="">cfe-dev@lists.llvm.org</a><br class="">
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/<wbr class="">mailman/listinfo/cfe-dev</a><br class="">
><br class="">
<span class="m_1428356291649310723m_-2916037794177904119m_-5986231835790600778HOEnZb"><font color="#888888" class=""><br class="">
<br class="">
<br class="">
--<br class="">
GCS a+ e++ d- C++ ULS$ L+$ !E- W++ P+++$ w++$ tv+ b++ DI D++ 5++<br class="">
The Tao of math: The numbers you can count are not the real numbers.<br class="">
Life is complex, with real and imaginary parts.<br class="">
"Ok, it boots. Which means it must be bug-free and perfect. " -- Linus Torvalds<br class="">
"People disagree with me. I just ignore them." -- Linus Torvalds<br class="">
</font></span></blockquote></div><br class=""></div>
</div></div><br class="">______________________________<wbr class="">_________________<br class="">
cfe-dev mailing list<br class="">
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank" class="">cfe-dev@lists.llvm.org</a><br class="">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/<wbr class="">mailman/listinfo/cfe-dev</a><br class="">
<br class=""></blockquote></div><br class=""></div>
</div></div></blockquote></div><br class=""></div>
</div></div></blockquote></div><br class=""></div>
_______________________________________________<br class="">cfe-dev mailing list<br class=""><a href="mailto:cfe-dev@lists.llvm.org" class="">cfe-dev@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev<br class=""></div></blockquote></div><br class=""></div></body></html>