llvm crashes when building pitch.c for iOS (opus 1.1rc2) with optimisation enabled and floating point
I am trying to build the latest opus 1.1rc2 within webrtc for iOS using the chromium gyp build framework.
The build flag OPUS_ARM_MAY_HAVE_NEON is defined to get access to any neon optimisations
Without minimal compiler optimisations (-O0) I see a message stating that opus will be very slow, but things build just fine.
With any optimisation set for iOS in the file trunk/build/common.gypi (i.e.., 'mac_debug_optimization%': 's', instead of '0') and building for FIXED_POINT (toggled 'use_opus_fixed_point%': 1, in trunk/third_party/opus/opus.gyp) then the compiler crashes and reports a problem similar to what is described here: http://lists.cs.uiuc.edu/pipermail/llvmbugs/2013-August/029853.html
The file that building stops at is celt/pitch.c
However building with fixed point and optimisation is not a problem.
More information about the llvm crash dump:
ninja: Entering directory `trunk/out_ios/Debug-iphoneos' [74/2136] CC obj/third_party/opus-1.1-rc2/src/celt/opus.pitch.o FAILED: ../../third_party/llvm-build/Release+Asserts/bin/clang -MMD -MF obj/third_party/opus-1.1-rc2/src/celt/opus.pitch.o.d -DANGLE_DX11 -DDISABLE_NACL -DCHROMIUM_BUILD -DUSE_LIBJPEG_TURBO=1 -DENABLE_INPUT_SPEECH -DENABLE_EGLIMAGE=1 -DCLD_VERSION=1 -DENABLE_SPELLCHECK=1 -DDISABLE_FTP_SUPPORT=1 -DOPUS_BUILD -DOPUS_EXPORT= -DHAVE_LRINT -DHAVE_LRINTF -DVAR_ARRAYS -DOPUS_ARM_MAY_HAVE_NEON -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DWTF_USE_DYNAMIC_ANNOTATIONS=1 -I../../third_party/opus-1.1-rc2/src/celt -I../../third_party/opus-1.1-rc2/src/include -I../../third_party/opus-1.1-rc2/src/silk -I../../third_party/opus-1.1-rc2/src/silk/float -isysroot /Applications/Xcode5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -O1 -gdwarf-2 -fvisibility=hidden -Wnewline-eof -miphoneos-version-min=6.0 -arch armv7 -Wendif-labels -Wno-unused-parameter -Wno-missing-field-initializers -Wheader-hygiene -Wno-c++11-narrowing -Wno-char-subscripts -Wno-unused-function -Wno-covered-switch-default -Wstring-conversion -Wno-deprecated-register -Wno-deprecated-declarations -Wheader-hygiene -Wno-char-subscripts -Wno-unused-function -Wno-unnamed-type-template-args -Wno-c++11-narrowing -std=c99 -Xclang -load -Xclang /Users/tommcguinness/webrtc2/trunk/tools/clang/scripts/../../../third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.dylib -Xclang -add-plugin -Xclang find-bad-constructs -fcolor-diagnostics -c ../../third_party/opus-1.1-rc2/src/celt/pitch.c -o obj/third_party/opus-1.1-rc2/src/celt/opus.pitch.o Assertion failed: (MLoc.isReg() && !Indirect && "This doesn't support offset/indirection - implement it if needed"), function EmitDwarfRegOp, file /work/chromium/src/third_party/llvm/lib/Target/ARM/ARMAsmPrinter.cpp, line 225. 0 clang 0x0000000101b5b138 llvm::sys::PrintStackTrace(__sFILE*) + 40 1 clang 0x0000000101b5b684 abort + 692 2 libsystem_platform.dylib 0x00007fff896ff5aa _sigtramp + 26 3 libsystem_platform.dylib 000000000000000000 _sigtramp + 1989151344 4 clang 0x0000000101b5b3e6 abort + 22 5 clang 0x0000000101b5b3c1 __assert_rtn + 81 6 clang 0x000000010103b135 std::_Rb_tree<llvm::MachineInstr*, std::pair<llvm::MachineInstr* const, unsigned int>, std::_Select1st<std::pair<llvm::MachineInstr* const, unsigned int> >, std::lessllvm::MachineInstr*, std::allocator<std::pair<llvm::MachineInstr* const, unsigned int> > >::_M_erase(std::_Rb_tree_node<std::pair<llvm::MachineInstr* const, unsigned int> >*) + 805 7 clang 0x000000010152ee8e llvm::DwarfDebug::emitDebugLoc() + 878 8 clang 0x000000010152e748 llvm::DwarfDebug::endModule() + 648 9 clang 0x00000001015082c3 llvm::AsmPrinter::doFinalization(llvm::Module&) + 563 10 clang 0x0000000101af24de llvm::FPPassManager::doFinalization(llvm::Module&) + 94 11 clang 0x0000000101af2816 llvm::MPPassManager::runOnModule(llvm::Module&) + 710 12 clang 0x0000000101af314f llvm::PassManagerImpl::run(llvm::Module&) + 543 13 clang 0x00000001001c5b4e clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::Module*, clang::BackendAction, llvm::raw_ostream*) + 5694 14 clang 0x00000001002cc813 clang::EmitObjAction::EmitObjAction(llvm::LLVMContext*) + 1555 15 clang 0x0000000100084b44 clang::MultiplexConsumer::HandleTranslationUnit(clang::ASTContext&) + 68 16 clang 0x000000010031fc54 clang::ParseAST(clang::Sema&, bool, bool) + 484 17 clang 0x00000001002cb801 clang::CodeGenAction::ExecuteAction() + 545 18 clang 0x0000000100069174 clang::FrontendAction::Execute() + 116 19 clang 0x00000001000422bd clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 973 20 clang 0x0000000100009064 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 3348 21 clang 0x0000000100001179 cc1_main(char const**, char const**, char const*, void*) + 793 22 clang 0x00000001000072b5 main + 8901 23 clang 0x0000000100000e34 start + 52 24 clang 0x000000000000007b start + 4294963835 Stack dump: 0. Program arguments: /Users/tommcguinness/webrtc2/trunk/third_party/llvm-build/Release+Asserts/bin/clang -cc1 -triple thumbv7-apple-ios6.0.0 -emit-obj -disable-free -main-file-name pitch.c -mrelocation-model pic -pic-level 2 -mdisable-fp-elim -masm-verbose -target-cpu cortex-a8 -target-feature +soft-float-abi -target-abi apcs-gnu -mfloat-abi soft -target-linker-version 133.3 -gdwarf-2 -coverage-file /Users/tommcguinness/webrtc2/trunk/out_ios/Debug-iphoneos/obj/third_party/opus-1.1-rc2/src/celt/opus.pitch.o -resource-dir /Users/tommcguinness/webrtc2/trunk/third_party/llvm-build/Release+Asserts/bin/../lib/clang/3.4 -dependency-file obj/third_party/opus-1.1-rc2/src/celt/opus.pitch.o.d -MT obj/third_party/opus-1.1-rc2/src/celt/opus.pitch.o -isysroot /Applications/Xcode5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -D ANGLE_DX11 -D DISABLE_NACL -D CHROMIUM_BUILD -D USE_LIBJPEG_TURBO=1 -D ENABLE_INPUT_SPEECH -D ENABLE_EGLIMAGE=1 -D CLD_VERSION=1 -D ENABLE_SPELLCHECK=1 -D DISABLE_FTP_SUPPORT=1 -D OPUS_BUILD -D OPUS_EXPORT= -D HAVE_LRINT -D HAVE_LRINTF -D VAR_ARRAYS -D OPUS_ARM_MAY_HAVE_NEON -D DYNAMIC_ANNOTATIONS_ENABLED=1 -D WTF_USE_DYNAMIC_ANNOTATIONS=1 -I ../../third_party/opus-1.1-rc2/src/celt -I ../../third_party/opus-1.1-rc2/src/include -I ../../third_party/opus-1.1-rc2/src/silk -I ../../third_party/opus-1.1-rc2/src/silk/float -O1 -Wnewline-eof -Wendif-labels -Wno-unused-parameter -Wno-missing-field-initializers -Wheader-hygiene -Wno-c++11-narrowing -Wno-char-subscripts -Wno-unused-function -Wno-covered-switch-default -Wstring-conversion -Wno-deprecated-register -Wno-deprecated-declarations -Wheader-hygiene -Wno-char-subscripts -Wno-unused-function -Wno-unnamed-type-template-args -Wno-c++11-narrowing -std=c99 -fdebug-compilation-dir /Users/tommcguinness/webrtc2/trunk/out_ios/Debug-iphoneos -ferror-limit 19 -fmessage-length 0 -fvisibility hidden -stack-protector 1 -mstackrealign -fblocks -fobjc-runtime=ios-6.0.0 -fencode-extended-block-signature -fsjlj-exceptions -fdiagnostics-show-option -fcolor-diagnostics -vectorize-slp -load /Users/tommcguinness/webrtc2/trunk/tools/clang/scripts/../../../third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.dylib -add-plugin find-bad-constructs -o obj/third_party/opus-1.1-rc2/src/celt/opus.pitch.o -x c ../../third_party/opus-1.1-rc2/src/celt/pitch.c
- parser at end of file
- Code generation clang: error: unable to execute command: Illegal instruction: 4 clang: error: clang frontend command failed due to signal (use -v to see invocation) clang version 3.4 (trunk 192635) Target: arm-apple-darwin13.0.0 Thread model: posix clang: note: diagnostic msg: PLEASE submit a bug report to http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and associated run script. clang: note: diagnostic msg:
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: Preprocessed source(s) and associated run script(s) are located at: clang: note: diagnostic msg: /var/folders/h1/51w8ct3j2mq60f_y9djxbhxh04m7j1/T/pitch-c74fe5.c clang: note: diagnostic msg: /var/folders/h1/51w8ct3j2mq60f_y9djxbhxh04m7j1/T/pitch-c74fe5.sh clang: note: diagnostic msg:
[74/2136] CC obj/third_party/opus-1.1-rc2/src/silk/opus.enc_API.o ninja: build stopped: subcommand failed.