Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

"Call site info was not updated" while building the Linux kernel for ARCH=mips 32r6_defconfig #47664

Open Quuxplusone opened 3 years ago

Quuxplusone commented 3 years ago
Bugzilla Link PR48695
Status NEW
Importance P enhancement
Reported by Nathan Chancellor (natechancellor@gmail.com)
Reported on 2021-01-07 20:34:02 -0800
Last modified on 2021-01-14 10:33:20 -0800
Version trunk
Hardware PC Windows NT
CC djordje.todorovic@syrmia.com, jeremy.morse.llvm@gmail.com, llvm-bugs@lists.llvm.org, ndesaulniers@google.com, simon@atanasyan.com
Fixed by commit(s)
Attachments
Blocks PR4068
Blocked by
See also
While building the Linux kernel's 32r6_defconfig for ARCH=mips:

$ make -skj"$(nproc)" ARCH=mips CC=clang CROSS_COMPILE=mips-linux-gnu-
O=out/mips distclean 32r6_defconfig arch/mips/kernel/reset.o
...
clang-12: /home/nathan/cbl/github/tc-build/llvm-
project/llvm/lib/CodeGen/MachineFunction.cpp:400: void
llvm::MachineFunction::DeleteMachineInstr(llvm::MachineI[260/97958]
sertion `(!MI->isCandidateForCallSiteEntry() || CallSitesInfo.find(MI) ==
CallSitesInfo.end()) && "Call site info was not updated!"' failed.
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: /home/nathan/cbl/github/tc-
build/build/llvm/stage1/bin/clang-12 -cc1 -triple mips-unknown-linux-gnu -S -
disable-free -main-file-name reset.c -mrelocation-model static -fno-delete-null-
pointer-checks -mllvm -warn-stack-size=1024 -mframe-pointer=none -relaxed-
aliasing -fmath-errno -fno-rounding-math -no-integrated-as -mconstructor-
aliases -ffreestanding -target-cpu mips32r6 -target-feature +noabicalls -target-
feature +soft-float -target-feature -nooddspreg -target-abi o32 -msoft-float -
mfloat-abi soft -mllvm -mno-check-zero-division -mllvm -mips-ssection-
threshold=0 -mllvm -mgpopt -fno-split-dwarf-inlining -debug-info-kind=limited -
dwarf-version=4 -debugger-tuning=gdb -nostdsysteminc -nobuiltininc -resource-
dir /home/nathan/cbl/github/tc-build/build/llvm/stage1/lib/clang/12.0.0 -
dependency-file arch/mips/kernel/.reset.o.d -MT arch/mips/kernel/reset.o -
isystem /home/nathan/cbl/github/tc-
build/build/llvm/stage1/lib/clang/12.0.0/include -include
/home/nathan/src/linux/include/linux/kconfig.h -include
/home/nathan/src/linux/include/linux/compiler_types.h -I
/home/nathan/src/linux/arch/mips/include -I ./arch/mips/include/generated -I
/home/nathan/src/linux/include -I ./include -I
/home/nathan/src/linux/arch/mips/include/uapi -I
./arch/mips/include/generated/uapi -I /home/nathan/src/linux/include/uapi -I
./include/generated/uapi -D __KERNEL__ -D
VMLINUX_LOAD_ADDRESS=0xffffffff80100000 -D LINKER_LOAD_ADDRESS=0x80100000 -D
DATAOFFSET=0 -D GAS_HAS_SET_HARDFLOAT -D TOOLCHAIN_SUPPORTS_VIRT -D
TOOLCHAIN_SUPPORTS_CRC -D TOOLCHAIN_SUPPORTS_DSP -D TOOLCHAIN_SUPPORTS_GINV -I
/home/nathan/src/linux/arch/mips/include/asm/mach-generic -I
/home/nathan/src/linux/arch/mips/include/asm/mach-generic -I
/home/nathan/src/linux/arch/mips/kernel -I ./arch/mips/kernel -D
KBUILD_MODFILE=\"arch/mips/kernel/reset\" -D KBUILD_BASENAME=\"reset\" -D
KBUILD_MODNAME=\"reset\" -fmacro-prefix-map=/home/nathan/src/linux/= -O2 -Wall -
Wundef -Werror=strict-prototypes -Wno-trigraphs -Werror=implicit-function-
declaration -Werror=implicit-int -Werror=return-type -Wno-format-security -
Werror=unknown-warning-option -Wno-frame-address -Wno-address-of-packed-member -
Wno-format-invalid-specifier -Wno-gnu -Wno-unused-const-variable -Wdeclaration-
after-statement -Wvla -Wno-pointer-sign -Wno-array-bounds -Werror=date-time -
Werror=incompatible-pointer-types -Wno-initializer-overrides -Wno-format -Wno-
sign-compare -Wno-format-zero-length -Wno-pointer-to-enum-cast -Wno-
tautological-constant-out-of-range-compare -Werror -std=gnu89 -fno-dwarf-
directory-asm -fdebug-compilation-dir /home/nathan/src/linux/out/mips -ferror-
limit 19 -fwrapv -stack-protector 2 -fwchar-type=short -fno-signed-wchar -fgnuc-
version=4.2.1 -fcolor-diagnostics -vectorize-loops -vectorize-slp -o /tmp/reset-
76bbb7.s -x c /home/nathan/src/linux/arch/mips/kernel/reset.c
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module
'/home/nathan/src/linux/arch/mips/kernel/reset.c'.
4.      Running pass 'Mips Delay Slot Filler' on function '@machine_halt'
 #0 0x00000000028d5a03 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-12+0x28d5a03)
 #1 0x00000000028d389e llvm::sys::RunSignalHandlers() (/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-12+0x28d389e)
 #2 0x00000000028d5ec5 SignalHandler(int) (/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-12+0x28d5ec5)
 #3 0x00007fc21d4873c0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x153c0)
 #4 0x00007fc21cf4c18b raise (/lib/x86_64-linux-gnu/libc.so.6+0x4618b)
 #5 0x00007fc21cf2b859 abort (/lib/x86_64-linux-gnu/libc.so.6+0x25859)
 #6 0x00007fc21cf2b729 (/lib/x86_64-linux-gnu/libc.so.6+0x25729)
 #7 0x00007fc21cf3cf36 (/lib/x86_64-linux-gnu/libc.so.6+0x36f36)
 #8 0x0000000001dd3602 llvm::MachineFunction::DeleteMachineInstr(llvm::MachineInstr*) (/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-12+0x1dd3602)
 #9 0x00000000016e3506 llvm::MachineBasicBlock::erase(llvm::MachineInstrBundleIterator<llvm::MachineInstr, false>) (/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-12+0x16e3506)
#10 0x0000000001790830 (anonymous
namespace)::MipsDelaySlotFiller::runOnMachineBasicBlock(llvm::MachineBasicBlock&)
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-12+0x1790830)
#11 0x00000000017904b0 (anonymous
namespace)::MipsDelaySlotFiller::runOnMachineFunction(llvm::MachineFunction&)
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-12+0x17904b0)
#12 0x0000000001ddad3d
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-12+0x1ddad3d)
#13 0x0000000002224288 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-12+0x2224288)
#14 0x000000000222af21 llvm::FPPassManager::runOnModule(llvm::Module&)
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-12+0x222af21)
#15 0x00000000022248a7 llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-12+0x22248a7)
#16 0x0000000002b0f4a8 clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::HeaderSearchOptions const&, 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<llvm::raw_pwrite_stream> >) (/home/nathan/cbl/github/tc-
build/build/llvm/stage1/bin/clang-12+0x2b0f4a8)
#17 0x00000000033a40ac
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-12+0x33a40ac)
#18 0x0000000003b10d74 clang::ParseAST(clang::Sema&, bool, bool)
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-12+0x3b10d74)
#19 0x0000000003304f40 clang::FrontendAction::Execute()
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-12+0x3304f40)
#20 0x00000000032625fa
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-12+0x32625fa)
#21 0x000000000339e038
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-12+0x339e038)
#22 0x00000000016be71b cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-
12+0x16be71b)
#23 0x00000000016bc3dc ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-12+0x16bc3dc)
#24 0x00000000016bc121 main (/home/nathan/cbl/github/tc-
build/build/llvm/stage1/bin/clang-12+0x16bc121)
#25 0x00007fc21cf2d0b3 __libc_start_main (/lib/x86_64-linux-
gnu/libc.so.6+0x270b3)
#26 0x00000000016b918e _start (/home/nathan/cbl/github/tc-
build/build/llvm/stage1/bin/clang-12+0x16b918e)
clang-12: error: unable to execute command: Aborted
clang-12: error: clang frontend command failed due to signal (use -v to see
invocation)
ClangBuiltLinux clang version 12.0.0 (https://github.com/llvm/llvm-project
f2f81c554b0d38edf754a220bcb063876747ee6b)
Target: mips-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/nathan/cbl/github/tc-build/build/llvm/stage1/bin
...

cvise spits out:

$ cat reset.i
(*pm_power_off)();
machine_power_off() { pm_power_off(); }

$ clang --target=mips-linux-gnu -march=mips32r6 -O2 -c -o /dev/null reset.i
...

$ echo ${?}
0

$ clang --target=mips-linux-gnu -march=mips32r6 -O2 -g -c -o /dev/null reset.i
...
clang: /home/nathan/cbl/github/tc-build/llvm-
project/llvm/lib/CodeGen/MachineFunction.cpp:400: void
llvm::MachineFunction::DeleteMachineInstr(llvm::MachineInstr *): Assertion
`(!MI->isCandidateForCallSiteEntry() || CallSitesInfo.find(MI) ==
CallSitesInfo.end()) && "Call site info was not updated!"' failed.
...

$ echo ${?}
134

$ git bisect log
# bad: [7ab7b979d29e1e43701cf690f5cf1903740f50e3] Bump the trunk major version
to 12
# good: [5852475e2c049ce29dcb1f0da3ac33035f8c9156] Bump the trunk major version
to 11
git bisect start 'llvmorg-12-init' 'llvmorg-11-init'
# good: [b98ad941a40c96c841bceb171725c925500fce6c] [flang] Merge flang-
compiler/f18
git bisect good b98ad941a40c96c841bceb171725c925500fce6c
# bad: [4cd3f4b31b0bd19f3b63f53888a5a2afea68e109] [WebAssembly] Fix a bug in
finding matching EH pad
git bisect bad 4cd3f4b31b0bd19f3b63f53888a5a2afea68e109
# good: [ec170b7ccd5bf7aa05dea80e6f246964fd081e98] [clangd] Fix whitespace
between chunks in markdown paragraphs.
git bisect good ec170b7ccd5bf7aa05dea80e6f246964fd081e98
# bad: [4db94094b469b4715d08ef37f1799bf3ea7ca8ea] clang-format: support aligned
nested conditionals formatting
git bisect bad 4db94094b469b4715d08ef37f1799bf3ea7ca8ea
# good: [77ecf90c52641aadedf6bad7c8bea5b217b49729] [COFF] Migrate
COFFObjectFile to Expected<T>
git bisect good 77ecf90c52641aadedf6bad7c8bea5b217b49729
# good: [cd83333fc8fa3d2924087485bc3d1998665b4987] [PowerPC] Fold redundant
load immediates of zero and delete if possible
git bisect good cd83333fc8fa3d2924087485bc3d1998665b4987
# good: [6e73f12a641bb8fd965d28937ea3a6d1dcecc8c0] Fix buildbots errors after
comitting D78782.
git bisect good 6e73f12a641bb8fd965d28937ea3a6d1dcecc8c0
# good: [accc6b55450510577f9cfa0b434c97e45ab5d6c6] LoadInst should store Align,
not MaybeAlign.
git bisect good accc6b55450510577f9cfa0b434c97e45ab5d6c6
# good: [f83d66c249bffe576460c7d233d295818775a651] Fixed bot failure after
4042ada1c1fe4a9cd5
git bisect good f83d66c249bffe576460c7d233d295818775a651
# bad: [710d9d66f8e2f8ac148ef9a3d226c6a8e22f15c5] [DebugInfo] -
DWARFDebugFrame: do not call abort() on errors.
git bisect bad 710d9d66f8e2f8ac148ef9a3d226c6a8e22f15c5
# good: [854f5f332af4640d9425e9a94442629e4f5a3f98] [Sema] Teach -Wcast-align to
compute an accurate alignment using the alignment information on VarDecls in
more cases
git bisect good 854f5f332af4640d9425e9a94442629e4f5a3f98
# bad: [56970ec6a0bed5ba4312872eed13137ca43f67fb] [llvm-readobj] - --gnu-hash-
table: do not crash when the GNU hash table goes past the EOF.
git bisect bad 56970ec6a0bed5ba4312872eed13137ca43f67fb
# bad: [170ac4be3392201d5f5e124e8a1b7d78de3f82c8] [CSInfo][ISEL] Call site info
generation support for Mips
git bisect bad 170ac4be3392201d5f5e124e8a1b7d78de3f82c8
# good: [d48ef7cab55878fbb598e7a968b6073f9c7aa9ed] [lldb] Print full Clang
diagnostics when the ClangModulesDeclVendor fails to compile a module
git bisect good d48ef7cab55878fbb598e7a968b6073f9c7aa9ed
# first bad commit: [170ac4be3392201d5f5e124e8a1b7d78de3f82c8] [CSInfo][ISEL]
Call site info generation support for Mips

I can reproduce this at current ToT (2ff36e79291486b489ae26418daa1b123473b405).
Quuxplusone commented 3 years ago
Thanks for finding this.
Here is the proposal: https://reviews.llvm.org/D94685