[llvm-bugs] [Bug 48603] New: Assertion failed: (BitWidth == RHS.BitWidth && "Bit widths must be the same" since "GlobalISel: Return APInt from getConstantVRegVal"

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Dec 26 08:09:47 PST 2020


https://bugs.llvm.org/show_bug.cgi?id=48603

            Bug ID: 48603
           Summary: Assertion failed: (BitWidth == RHS.BitWidth && "Bit
                    widths must be the same" since "GlobalISel: Return
                    APInt from getConstantVRegVal"
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: stephan.bergmann.secondary at googlemail.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    Matthew.Arsenault at amd.com, neeilans at live.com,
                    richard-llvm at metafoo.co.uk

Since
<https://github.com/llvm/llvm-project/commit/581d13f8aeb66c040d5ea69ad4385f766e1f97c9>
"GlobalISel: Return APInt from getConstantVRegVal", the attached reproducer
(which I didn't bother try to reduce, though) fails with

> Assertion failed: (BitWidth == RHS.BitWidth && "Bit widths must be the same"), function operator+=, file /Users/stephan/github.com/llvm/llvm-project/llvm/lib/Support/APInt.cpp, line 194.
> PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
> Stack dump:
> 0.	Program arguments: /Users/stephan/llvm/inst/bin/clang++ -target arm64-apple-macos -stdlib=libc++ -mmacosx-version-min=11.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -ferror-limit=0 -DU_ATTRIBUTE_DEPRECATED= -DU_COMMON_IMPLEMENTATION -DHAVE_GCC_ATOMICS=0 -DU_HAVE_STRTOD_L=1 -DU_HAVE_XLOCALE_H=1 -DU_HAVE_STRING_VIEW=1 -I. "-DDEFAULT_ICU_PLUGINS=\"/usr/local/lib/icu\" " -std=c++2b -O0 -fstrict-aliasing -fstrict-overflow -fno-strict-aliasing -ggdb2 -gsplit-dwarf -Xclang -debug-info-kind=constructor -W -Wall -pedantic -Wpointer-arith -Wwrite-strings -Wno-long-long -fvisibility=hidden -fno-common -c -dynamic -MMD -MT "ubidi.d ubidi.o ubidi.ao" -o ubidi.o ubidi.cpp
> 1.	<eof> parser at end of file
> 2.	Code generation
> 3.	Running pass 'Function Pass Manager' on module 'ubidi.cpp'.
> 4.	Running pass 'AArch64PreLegalizerCombiner' on function '@_ZL14checkParaCountP5UBiDi'
> Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
> 0  clang++                  0x0000000103dfa470 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
> 1  clang++                  0x0000000103df9534 llvm::sys::RunSignalHandlers() + 128
> 2  clang++                  0x0000000103df9bec llvm::sys::CleanupOnSignal(unsigned long) + 236
> 3  clang++                  0x0000000103d556dc (anonymous namespace)::CrashRecoveryContextImpl::HandleCrash(int, unsigned long) + 128
> 4  clang++                  0x0000000103d558c0 CrashRecoverySignalHandler(int) + 152
> 5  libsystem_platform.dylib 0x00000001a3838c44 _sigtramp + 56
> 6  libsystem_pthread.dylib  0x00000001a37f0c24 pthread_kill + 292
> 7  libsystem_c.dylib        0x00000001a3738864 abort + 104
> 8  libsystem_c.dylib        0x00000001a3737b68 err + 0
> 9  clang++                  0x00000001066cab58 llvm::APInt::tcAdd(unsigned long long*, unsigned long long const*, unsigned long long, unsigned int) (.cold.1) + 0
> 10 clang++                  0x0000000103d289b8 llvm::APInt::tcAdd(unsigned long long*, unsigned long long const*, unsigned long long, unsigned int) + 0
> 11 clang++                  0x00000001046e8d3c llvm::CombinerHelper::matchShiftImmedChain(llvm::MachineInstr&, llvm::RegisterImmPair&) + 348
> 12 clang++                  0x000000010233d9a8 (anonymous namespace)::AArch64GenPreLegalizerCombinerHelper::tryCombineAll(llvm::GISelChangeObserver&, llvm::MachineInstr&, llvm::MachineIRBuilder&) const + 14272
> 13 clang++                  0x0000000102338d00 (anonymous namespace)::AArch64PreLegalizerCombinerInfo::combine(llvm::GISelChangeObserver&, llvm::MachineInstr&, llvm::MachineIRBuilder&) const + 76
> 14 clang++                  0x00000001046e1c40 llvm::Combiner::combineMachineInstrs(llvm::MachineFunction&, llvm::GISelCSEInfo*) + 2076
> 15 clang++                  0x0000000102338b18 (anonymous namespace)::AArch64PreLegalizerCombiner::runOnMachineFunction(llvm::MachineFunction&) + 776
> 16 clang++                  0x00000001033e5f9c llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 364
> 17 clang++                  0x00000001037212e8 llvm::FPPassManager::runOnFunction(llvm::Function&) + 744
> 18 clang++                  0x0000000103726aa4 llvm::FPPassManager::runOnModule(llvm::Module&) + 68
> 19 clang++                  0x00000001037218c8 llvm::legacy::PassManagerImpl::run(llvm::Module&) + 964
> 20 clang++                  0x000000010403d1bc clang::EmitBackendOutput(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_pwrite_stream, std::__1::default_delete<llvm::raw_pwrite_stream> >) + 9928
> 21 clang++                  0x0000000104289834 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) + 876
> 22 clang++                  0x000000010515fe88 clang::ParseAST(clang::Sema&, bool, bool) + 524
> 23 clang++                  0x000000010452c1d0 clang::FrontendAction::Execute() + 100
> 24 clang++                  0x00000001044d3f04 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 1940
> 25 clang++                  0x0000000104596408 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1264
> 26 clang++                  0x000000010230853c cc1_main(llvm::ArrayRef<char const*>, char const*, void*) + 1716
> 27 clang++                  0x000000010230670c ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&) + 780
> 28 clang++                  0x000000010438cba0 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, bool*) const::$_1>(long) + 28
> 29 clang++                  0x0000000103d555f0 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) + 244
> 30 clang++                  0x000000010438c250 clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, bool*) const + 360
> 31 clang++                  0x0000000104366ecc clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&) const + 220
> 32 clang++                  0x000000010436732c clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::__1::pair<int, clang::driver::Command const*> >&) const + 116
> 33 clang++                  0x000000010437930c clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::__1::pair<int, clang::driver::Command const*> >&) + 224
> 34 clang++                  0x0000000102305f38 main + 8520
> 35 libdyld.dylib            0x00000001a380cf34 start + 4
> clang-12: error: clang frontend command failed with exit code 134 (use -v to see invocation)
> clang version 12.0.0 (https://github.com/llvm/llvm-project.git 581d13f8aeb66c040d5ea69ad4385f766e1f97c9)
> Target: arm64-apple-macos
> Thread model: posix
> InstalledDir: /Users/stephan/llvm/inst/bin
> clang-12: note: diagnostic msg: 
> ********************
> 
> PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
> Preprocessed source(s) and associated run script(s) are located at:
> clang-12: note: diagnostic msg: /Users/stephan/lo/tmp/ubidi-6a2c33.cpp
> clang-12: note: diagnostic msg: /Users/stephan/lo/tmp/ubidi-6a2c33.sh
> clang-12: note: diagnostic msg: Crash backtrace is located in
> clang-12: note: diagnostic msg: /Users/stephan/Library/Logs/DiagnosticReports/clang-12_<YYYY-MM-DD-HHMMSS>_<hostname>.crash
> clang-12: note: diagnostic msg: (choose the .crash file that corresponds to your crash)
> clang-12: note: diagnostic msg: 
> 
> ********************
> *** Failed compilation command follows: ----------------------------------------------------------
> /Users/stephan/llvm/inst/bin/clang++ -target arm64-apple-macos -stdlib=libc++ -mmacosx-version-min=11.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -ferror-limit=0 -DU_ATTRIBUTE_DEPRECATED= -DU_COMMON_IMPLEMENTATION -DHAVE_GCC_ATOMICS=0 -DU_HAVE_STRTOD_L=1 -DU_HAVE_XLOCALE_H=1 -DU_HAVE_STRING_VIEW=1 -I. -DDEFAULT_ICU_PLUGINS="/usr/local/lib/icu"  -std=c++2b -O0 -fstrict-aliasing -fstrict-overflow -fno-strict-aliasing -ggdb2 -gsplit-dwarf -Xclang -debug-info-kind=constructor -W -Wall -pedantic -Wpointer-arith -Wwrite-strings -Wno-long-long -fvisibility=hidden -fno-common -c -dynamic -MMD -MT ubidi.d ubidi.o ubidi.ao -o ubidi.o ubidi.cpp

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20201226/15ceb42d/attachment.html>


More information about the llvm-bugs mailing list