llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.23k stars 11.66k forks source link

Regression(r281215): `Assertion `Opc && "Impossible reg-to-reg copy"' failed` when building chrome for android with trunk clang #29706

Closed nico closed 8 years ago

nico commented 8 years ago
Bugzilla Link 30358
Resolution FIXED
Resolved on Sep 13, 2016 03:24
Version trunk
OS Linux
Attachments repro
CC @jmolloy

Extended Description

[1/1] CC obj/third_party/ffmpeg/ffmpeg_internal/eval.o FAILED: obj/third_party/ffmpeg/ffmpeg_internal/eval.o ../../../../llvm-build/bin/clang -MMD -MF obj/third_party/ffmpeg/ffmpeg_internal/eval.o.d -DHAVE_AV_CONFIG_H -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -DPIC -DFF_API_CONVERGENCE_DURATION=0 -D_ISOC99_SOURCE -D_LARGEFILE_SOURCE -DV8_DEPRECATION_WARNINGS -DENABLE_NOTIFICATIONS -DENABLE_BROWSER_CDMS -DENABLE_PRINTING=1 -DENABLE_BASIC_PRINTING=1 -DENABLE_SPELLCHECK=1 -DUSE_BROWSER_SPELLCHECKER=1 -DUSE_OPENSSL_CERTS=1 -DNO_TCMALLOC -DUSE_EXTERNAL_POPUP_MENU=1 -DENABLE_WEBRTC=1 -DDISABLE_NACL -DENABLE_SUPERVISED_USERS=1 -DVIDEO_HOLE=1 -DSAFE_BROWSING_DB_REMOTE -DCHROMIUM_BUILD -DENABLE_MEDIA_ROUTER=1 -DENABLE_WEBVR -DFIELDTRIAL_TESTING_ENABLED -DCR_CLANG_REVISION=280836-1 -D_FILE_OFFSET_BITS=64 -DANDROID -DHAVE_SYS_UIO_H -DANDROID_NDK_VERSION=r12b -DCOMPONENT_BUILD -DGNU_SOURCE=1 -D__compiler_offsetof=builtin_offsetof -Dnan=__builtin_nan -D_DEBUG -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DWTF_USE_DYNAMIC_ANNOTATIONS=1 -I../../third_party/ffmpeg/chromium/config/Chromium/android/arm-neon -I../../third_party/ffmpeg -I../.. -Igen -fPIC -fomit-frame-pointer -Wno-deprecated-declarations -std=c99 -pthread -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -fomit-frame-pointer -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -funwind-tables -fPIC -pipe -fcolor-diagnostics -ffunction-sections -fno-short-enums --target=arm-linux-androideabi -march=armv7-a -mfloat-abi=softfp -mthumb -mtune=generic-armv7-a -mfpu=neon -gdwarf-3 -g2 --sysroot=../../third_party/android_tools/ndk/platforms/android-16/arch-arm -Wheader-hygiene -Wstring-conversion -Werror -Wall -Wno-unused-variable -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-covered-switch-default -Wno-deprecated-register -Wno-unneeded-internal-declaration -Wno-inconsistent-missing-override -Wno-shift-negative-value -Wno-undefined-var-template -Wno-nonportable-include-path -Wno-address-of-packed-member -Wno-incompatible-pointer-types -Wno-absolute-value -Wno-deprecated-declarations -Wno-incompatible-pointer-types -Wno-logical-op-parentheses -Wno-parentheses -Wno-pointer-sign -Wno-switch -Wno-unused-label -Wno-unused-variable -Wno-string-conversion -Wno-sometimes-uninitialized -Wno-unused-function -Wno-constant-conversion -O2 -fno-ident -fdata-sections -ffunction-sections -fvisibility=default -c ../../third_party/ffmpeg/libavutil/eval.c -o obj/third_party/ffmpeg/ffmpeg_internal/eval.o clang-3.9: /usr/local/google/home/thakis/src/llvm-rw/lib/Target/ARM/ARMBaseInstrInfo.cpp:818: virtual void llvm::ARMBaseInstrInfo::copyPhysReg(llvm::MachineBasicBlock&, llvm::MachineBasicBlock::iterator, const llvm::DebugLoc&, unsigned int, unsigned int, bool) const: Assertion `Opc && "Impossible reg-to-reg copy"' failed.

​0 0x0000000001ca8175 llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/usr/local/google/home/thakis/src/llvm-build/bin/clang-3.9+0x1ca8175)

​1 0x0000000001ca611e llvm::sys::RunSignalHandlers() (/usr/local/google/home/thakis/src/llvm-build/bin/clang-3.9+0x1ca611e)

​2 0x0000000001ca6282 SignalHandler(int) (/usr/local/google/home/thakis/src/llvm-build/bin/clang-3.9+0x1ca6282)

​3 0x00007f637a0c4330 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x10330)

​4 0x00007f6378ebfc37 gsignal /build/eglibc-oGUzwX/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0

​5 0x00007f6378ec3028 abort /build/eglibc-oGUzwX/eglibc-2.19/stdlib/abort.c:91:0

​6 0x00007f6378eb8bf6 __assert_fail_base /build/eglibc-oGUzwX/eglibc-2.19/assert/assert.c:92:0

​7 0x00007f6378eb8ca2 (/lib/x86_64-linux-gnu/libc.so.6+0x2fca2)

​8 0x0000000000cfb07f llvm::ARMBaseInstrInfo::copyPhysReg(llvm::MachineBasicBlock&, llvm::MachineInstrBundleIterator<llvm::MachineInstr, false>, llvm::DebugLoc const&, unsigned int, unsigned int, bool) const (/usr/local/google/home/thakis/src/llvm-build/bin/clang-3.9+0xcfb07f)

​9 0x0000000000d2eebf llvm::Thumb2InstrInfo::copyPhysReg(llvm::MachineBasicBlock&, llvm::MachineInstrBundleIterator<llvm::MachineInstr, false>, llvm::DebugLoc const&, unsigned int, unsigned int, bool) const (/usr/local/google/home/thakis/src/llvm-build/bin/clang-3.9+0xd2eebf)

​10 0x00000000017e4868 (anonymous namespace)::ExpandPostRA::runOnMachineFunction(llvm::MachineFunction&) (/usr/local/google/home/thakis/src/llvm-build/bin/clang-3.9+0x17e4868)

​11 0x0000000001680593 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (/usr/local/google/home/thakis/src/llvm-build/bin/clang-3.9+0x1680593)

​12 0x0000000001922c73 llvm::FPPassManager::runOnFunction(llvm::Function&) (/usr/local/google/home/thakis/src/llvm-build/bin/clang-3.9+0x1922c73)

​13 0x0000000001922d1c llvm::FPPassManager::runOnModule(llvm::Module&) (/usr/local/google/home/thakis/src/llvm-build/bin/clang-3.9+0x1922d1c)

​14 0x000000000192333f llvm::legacy::PassManagerImpl::run(llvm::Module&) (/usr/local/google/home/thakis/src/llvm-build/bin/clang-3.9+0x192333f)

​15 0x0000000001e08148 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 >) (/usr/local/google/home/thakis/src/llvm-build/bin/clang-3.9+0x1e08148)

​16 0x00000000024075d8 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/usr/local/google/home/thakis/src/llvm-build/bin/clang-3.9+0x24075d8)

​17 0x00000000027ccd82 clang::ParseAST(clang::Sema&, bool, bool) (/usr/local/google/home/thakis/src/llvm-build/bin/clang-3.9+0x27ccd82)

Repro coming in a second.

jmolloy commented 8 years ago

Hi Nico,

Thanks for the prompt revert on this. I've identified the bug and will reapply with a fix in place and testcase.

The issue was that I hadn't taken into account that ARMISD::CMOV can have non-integer type. We can of course do a select of floats.

jmolloy commented 8 years ago

Reduced reproducer Adding reduced testcase:

llc reduced.ll -o /dev/null

nico commented 8 years ago

It's from 281215.

thakis@thakis:~/src/llvm-rw$ svn merge -c -281215 . --- Reverse-merging r281215 into '.': U test/CodeGen/Thumb2/float-ops.ll U test/CodeGen/Thumb/thumb-shrink-wrapping.ll U test/CodeGen/ARM/call-tc.ll U test/CodeGen/ARM/arm-and-tst-peephole.ll U test/CodeGen/ARM/debug-info-branch-folding.ll U test/CodeGen/ARM/arm-shrink-wrapping.ll D test/CodeGen/ARM/and-cmpz.ll U lib/Target/ARM/ARMBaseInstrInfo.cpp U lib/Target/ARM/ARMISelDAGToDAG.cpp --- Recording mergeinfo for reverse merge of r281215 into '.': U . thakis@thakis:~/src/llvm-rw$ svn log lib/Target/ARM/ARMBaseInstrInfo.cpp | less thakis@thakis:~/src/llvm-rw$ svn commit -m 'Revert r281215, it caused llvm/llvm-project#29706 .' Sending lib/Target/ARM/ARMBaseInstrInfo.cpp Sending lib/Target/ARM/ARMISelDAGToDAG.cpp Deleting test/CodeGen/ARM/and-cmpz.ll Sending test/CodeGen/ARM/arm-and-tst-peephole.ll Sending test/CodeGen/ARM/arm-shrink-wrapping.ll Sending test/CodeGen/ARM/call-tc.ll Sending test/CodeGen/ARM/debug-info-branch-folding.ll Sending test/CodeGen/Thumb/thumb-shrink-wrapping.ll Sending test/CodeGen/Thumb2/float-ops.ll Transmitting file data ........ Committed revision 281263.