<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">filed the bug. looks like a crash specific to targeting PPC. crashes 3.5 & 3.4.1<div><br></div><div><br></div><div><br><div><div>On May 28, 2014, at 8:22 AM, James Gregurich <<a href="mailto:bayoubengal@mac.com">bayoubengal@mac.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html charset=windows-1252"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">howdy!<div><br></div><div>Is __thread suppose to work?  I got a crash which compiling libkqueue. it is complaining about…</div><div><br></div><div><br></div><div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(187, 44, 162);">const<span style=""> </span>char<span style=""> *</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">kevent_dump(<span style="color: #bb2ca2">const</span> <span style="color: #bb2ca2">struct</span> kevent *kev)</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">{</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(187, 44, 162);"><span style="">    </span>static<span style=""> </span>__thread<span style=""> </span>char<span style=""> buf[</span><span style="color: #272ad8">1024</span><span style="">];</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;"><br></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">    snprintf((<span style="color: #bb2ca2">char</span> *) &buf[<span style="color: #272ad8">0</span>], <span style="color: #bb2ca2">sizeof</span>(buf),</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(209, 47, 27);"><span style="">            </span>"{ ident=%d, filter=%s, %s, %s, data=%d, udata=%p }"<span style="">,</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">            (u_int) kev->ident,</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">            kevent_filter_dump(kev),</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">            kevent_flags_dump(kev),</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">            kevent_fflags_dump(kev),</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">            (<span style="color: #bb2ca2">int</span>) kev->data,</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">            kev->udata);</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;"><br></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">    <span style="color: #bb2ca2">return</span> ((<span style="color: #bb2ca2">const</span> <span style="color: #bb2ca2">char</span> *) &buf[<span style="color: #272ad8">0</span>]);</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">}</div></div><div><br></div><div><br></div><div>I won’t bother submitting a bug report and a test file if __thread isn’t properly implemented (at least on powerpc linux) yet.</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div>crash log if someone is interested….</div><div><br></div><div><br></div><div><div style="margin: 0px; font-size: 10px; font-family: Monaco;">Assertion failed: ((TLI.getTypeAction(*DAG.getContext(), Node->getOperand(i).getValueType()) == TargetLowering::TypeLegal || Node->getOperand(i).getOpcode() == ISD::TargetConstant) && "Unexpected illegal type!"), function LegalizeOp, file /Volumes/storage/clangcrosscompiler/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp, line 1174.</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;">0  clang                    0x00000001108104b8 void* llvm::object_creator<llvm::sys::ThreadLocal<llvm::PrettyStackTraceEntry const> >() + 15240</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;">1  clang                    0x00000001108109b4 void* llvm::object_creator<llvm::sys::ThreadLocal<llvm::PrettyStackTraceEntry const> >() + 16516</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;">2  libsystem_platform.dylib 0x00007fff91f8e5aa _sigtramp + 26</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;">3  libsystem_platform.dylib 000000000000000000 _sigtramp + 1845959280</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;">4  clang                    0x0000000110810766 void* llvm::object_creator<llvm::sys::ThreadLocal<llvm::PrettyStackTraceEntry const> >() + 15926</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;">5  clang                    0x0000000110810741 void* llvm::object_creator<llvm::sys::ThreadLocal<llvm::PrettyStackTraceEntry const> >() + 15889</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;">6  clang                    0x000000011002428d void std::__1::vector<std::__1::pair<llvm::Type*, llvm::Type* const*>, std::__1::allocator<std::__1::pair<llvm::Type*, llvm::Type* const*> > >::__push_back_slow_path<std::__1::pair<llvm::Type*, llvm::Type* const*> >(std::__1::pair<llvm::Type*, llvm::Type* const*>&&) + 53901</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;">7  clang                    0x000000011001cb7b void std::__1::vector<std::__1::pair<llvm::Type*, llvm::Type* const*>, std::__1::allocator<std::__1::pair<llvm::Type*, llvm::Type* const*> > >::__push_back_slow_path<std::__1::pair<llvm::Type*, llvm::Type* const*> >(std::__1::pair<llvm::Type*, llvm::Type* const*>&&) + 23419</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;">8  clang                    0x00000001101333f6 llvm::SmallVectorTemplateBase<llvm::MachineModuleInfo::VariableDbgInfo, false>::grow(unsigned long) + 36422</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;">9  clang                    0x0000000110131e0e llvm::SmallVectorTemplateBase<llvm::MachineModuleInfo::VariableDbgInfo, false>::grow(unsigned long) + 30814</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;">10 clang                    0x000000011012f6fa llvm::SmallVectorTemplateBase<llvm::MachineModuleInfo::VariableDbgInfo, false>::grow(unsigned long) + 20810</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;">11 clang                    0x000000010fe1e468 void std::__1::vector<std::__1::pair<llvm::MCSymbol*, llvm::MCSymbol*>, std::__1::allocator<std::__1::pair<llvm::MCSymbol*, llvm::MCSymbol*> > >::__push_back_slow_path<std::__1::pair<llvm::MCSymbol*, llvm::MCSymbol*> >(std::__1::pair<llvm::MCSymbol*, llvm::MCSymbol*>&&) + 115768</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;">12 clang                    0x00000001102714cc llvm::raw_ostream& llvm::WriteGraph<llvm::MachineFunction const*>(llvm::raw_ostream&, llvm::MachineFunction const* const&, bool, llvm::Twine const&) + 5916</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;">13 clang                    0x00000001107a110d void* llvm::object_creator<llvm::LeakDetectorImpl<void> >() + 25485</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;">14 clang                    0x00000001107a139b void* llvm::object_creator<llvm::LeakDetectorImpl<void> >() + 26139</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;">15 clang                    0x00000001107a19cc void* llvm::object_creator<llvm::LeakDetectorImpl<void> >() + 27724</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;">16 clang                    0x000000010eba4dee void std::__1::vector<clang::serialization::ModuleFile*, std::__1::allocator<clang::serialization::ModuleFile*> >::__push_back_slow_path<clang::serialization::ModuleFile* const&>(clang::serialization::ModuleFile* const&&&) + 8590</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;">17 clang                    0x000000010eccdcab llvm::SmallVectorTemplateBase<llvm::DenseMap<clang::BaseSubobject, unsigned long long, llvm::DenseMapInfo<clang::BaseSubobject> >, false>::grow(unsigned long) + 22379</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;">18 clang                    0x000000010ed2e7e4 void std::__1::vector<clang::CXXRecordDecl const*, std::__1::allocator<clang::CXXRecordDecl const*> >::__push_back_slow_path<clang::CXXRecordDecl const* const&>(clang::CXXRecordDecl const* const&&&) + 139348</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;">19 clang                    0x000000010eccc6c8 llvm::SmallVectorTemplateBase<llvm::DenseMap<clang::BaseSubobject, unsigned long long, llvm::DenseMapInfo<clang::BaseSubobject> >, false>::grow(unsigned long) + 16776</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;">20 clang                    0x000000010ea29443 std::__1::__tree<std::__1::__value_type<clang::edit::FileOffset, clang::edit::EditedSource::FileEdit>, std::__1::__map_value_compare<clang::edit::FileOffset, std::__1::__value_type<clang::edit::FileOffset, clang::edit::EditedSource::FileEdit>, std::__1::less<clang::edit::FileOffset>, true>, std::__1::allocator<std::__1::__value_type<clang::edit::FileOffset, clang::edit::EditedSource::FileEdit> > >::destroy(std::__1::__tree_node<std::__1::__value_type<clang::edit::FileOffset, clang::edit::EditedSource::FileEdit>, void*>*) + 7571</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;">21 clang                    0x000000010ea0167d void std::__1::vector<clang::FrontendInputFile, std::__1::allocator<clang::FrontendInputFile> >::__push_back_slow_path<clang::FrontendInputFile const&>(clang::FrontendInputFile const&&&) + 17821</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;">22 clang                    0x000000010e9c509a void std::__1::__tree_balance_after_insert<std::__1::__tree_node_base<void*>*>(std::__1::__tree_node_base<void*>*, std::__1::__tree_node_base<void*>*) + 4426</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;">23 clang                    0x000000010e9bcc9f</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;">24 clang                    0x000000010e9c2e2d void std::__1::vector<llvm::SourceMgr::SrcBuffer, std::__1::allocator<llvm::SourceMgr::SrcBuffer> >::__push_back_slow_path<llvm::SourceMgr::SrcBuffer const&>(llvm::SourceMgr::SrcBuffer const&&&) + 9181</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;">25 libdyld.dylib            0x00007fff8ec625fd start + 1</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;">26 libdyld.dylib            0x000000000000004a start + 1899616846</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;">Stack dump:</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;">0.<span class="Apple-tab-span" style="white-space:pre"> </span>Program arguments: /Volumes/dev/devel/comx_p2020_linux_3_8_tools/bin/clang -cc1 -triple powerpc-unknown-linux -S -disable-free -main-file-name kevent.c -mrelocation-model pic -pic-level 2 -mdisable-fp-elim -fmath-errno -no-integrated-as -mconstructor-aliases -target-cpu ppc -target-linker-version 136 -g -coverage-file /var/folders/yb/mnfx7n_14xvdwy23w9f_wt9c0000gn/T/kevent-882b66.s -resource-dir /Volumes/dev/devel/comx_p2020_linux_3_8_tools/bin/../lib/clang/3.5.0 -D HAVE_CONFIG_H -D _XOPEN_SOURCE=600 -D PIC -I . -I ./src/common -I ./include -isysroot /devel/linux_sysroot_3.8 -internal-isystem /devel/linux_sysroot_3.8/usr/local/include -internal-isystem /Volumes/dev/devel/comx_p2020_linux_3_8_tools/bin/../lib/clang/3.5.0/include -internal-externc-isystem /devel/linux_sysroot_3.8/include -internal-externc-isystem /devel/linux_sysroot_3.8/usr/include -O2 -Wall -Wextra -Wno-missing-field-initializers -Werror -std=c99 -fno-dwarf-directory-asm -fdebug-compilation-dir /Volumes/Old_HD/media_store/Downloads/gcd/libkqueue-2.0.1 -ferror-limit 19 -fmessage-length 316 -fvisibility hidden -mstackrealign -fno-signed-char -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp -o /var/folders/yb/mnfx7n_14xvdwy23w9f_wt9c0000gn/T/kevent-882b66.s -x c src/common/kevent.c </div><div style="margin: 0px; font-size: 10px; font-family: Monaco;">1.<span class="Apple-tab-span" style="white-space:pre">       </span><eof> parser at end of file</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;">2.<span class="Apple-tab-span" style="white-space:pre">     </span>Code generation</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;">3.<span class="Apple-tab-span" style="white-space:pre">       </span>Running pass 'Function Pass Manager' on module 'src/common/kevent.c'.</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;">4.<span class="Apple-tab-span" style="white-space:pre"> </span>Running pass 'PowerPC DAG->DAG Pattern Instruction Selection' on function '@kevent_dump'</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;">clang: error: unable to execute command: Illegal instruction: 4</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;">clang: error: clang frontend command failed due to signal (use -v to see invocation)</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;">clang version 3.5.0 (trunk 205694)</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;">Target: powerpc-unknown-linux</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;">Thread model: posix</div><div><br></div><div><br></div><div><br></div></div></div>_______________________________________________<br>cfe-dev mailing list<br><a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev<br></blockquote></div><br></div></body></html>