[PATCH] D125506: [PowerPC] Implement XL compat __fnabs and __fnabss builtins.
Nathan Chancellor via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri May 20 13:04:29 PDT 2022
nathanchance added subscribers: nickdesaulniers, nathanchance.
nathanchance added a comment.
I bisected a crash when compiling the Linux kernel to this change.
A reduced C reproducer:
enum {
OP_CB_GETATTR = 3,
OP_CB_RECALL,
OP_CB_RECALL_ANY = 8,
OP_CB_RECALL_SLOT = 10,
OP_CB_NOTIFY_LOCK = 13,
OP_CB_NOTIFY_DEVICEID,
OP_CB_OFFLOAD
} static callback_ops_0;
int preprocess_nfs42_op_op_nr, preprocess_nfs42_op_op;
void preprocess_nfs42_op() {
switch (preprocess_nfs42_op_op_nr)
case OP_CB_GETATTR:
case OP_CB_RECALL:
case OP_CB_RECALL_ANY:
case OP_CB_RECALL_SLOT:
case OP_CB_NOTIFY_DEVICEID:
case OP_CB_NOTIFY_LOCK:
preprocess_nfs42_op_op = preprocess_nfs42_op_op_nr;
if (preprocess_nfs42_op_op_nr == OP_CB_OFFLOAD)
preprocess_nfs42_op_op = callback_ops_0;
}
$ clang --version | head -1
ClangBuiltLinux clang version 15.0.0 (https://github.com/llvm/llvm-project 559b8fc17ef6f5a65ccf9a11fce5f91c0a011b00)
$ clang --target=powerpc64le-linux-gnu -O2 -Wall -Wextra -c -o /dev/null callback_xdr.i
$ clang --version | head -1
ClangBuiltLinux clang version 15.0.0 (https://github.com/llvm/llvm-project c35ca3a1c78f693b749ad11742350b7fc6c5cd89)
$ clang --target=powerpc64le-linux-gnu -O2 -Wall -Wextra -c -o /dev/null callback_xdr.i
Impossible reg-to-reg copy
UNREACHABLE executed at /home/nathan/cbl/src/llvm-project/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp:1861!
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: clang --target=powerpc64le-linux-gnu -O2 -Wall -Wextra -c -o /dev/null callback_xdr.i
1. <eof> parser at end of file
2. Code generation
3. Running pass 'Function Pass Manager' on module 'callback_xdr.i'.
4. Running pass 'Post-RA pseudo instruction expansion pass' on function '@preprocess_nfs42_op'
#0 0x000055a3bcb4e583 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/nathan/tmp/build/llvm-bisect/stage1/bin/clang-15+0x3351583)
#1 0x000055a3bcb4c50e llvm::sys::RunSignalHandlers() (/home/nathan/tmp/build/llvm-bisect/stage1/bin/clang-15+0x334f50e)
#2 0x000055a3bcad2923 (anonymous namespace)::CrashRecoveryContextImpl::HandleCrash(int, unsigned long) CrashRecoveryContext.cpp:0:0
#3 0x000055a3bcad2a9e CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
#4 0x00007f4af3152b00 __restore_rt (/lib64/libc.so.6+0x3eb00)
#5 0x00007f4af31a2d0c __pthread_kill_implementation (/lib64/libc.so.6+0x8ed0c)
#6 0x00007f4af3152a56 gsignal (/lib64/libc.so.6+0x3ea56)
#7 0x00007f4af313c7f4 abort (/lib64/libc.so.6+0x287f4)
#8 0x000055a3bcad787f (/home/nathan/tmp/build/llvm-bisect/stage1/bin/clang-15+0x32da87f)
#9 0x000055a3bb83b308 llvm::PPCInstrInfo::copyPhysReg(llvm::MachineBasicBlock&, llvm::MachineInstrBundleIterator<llvm::MachineInstr, false>, llvm::DebugLoc const&, llvm::MCRegister, llvm::MCRegister, bool) const PPCInstrInfo.cpp:0:0
#10 0x000055a3bc1242bb (anonymous namespace)::ExpandPostRA::runOnMachineFunction(llvm::MachineFunction&) ExpandPostRAPseudos.cpp:0:0
#11 0x000055a3bbf62d4d llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (/home/nathan/tmp/build/llvm-bisect/stage1/bin/clang-15+0x2765d4d)
#12 0x000055a3bc3fc107 llvm::FPPassManager::runOnFunction(llvm::Function&) (/home/nathan/tmp/build/llvm-bisect/stage1/bin/clang-15+0x2bff107)
#13 0x000055a3bc403b81 llvm::FPPassManager::runOnModule(llvm::Module&) (/home/nathan/tmp/build/llvm-bisect/stage1/bin/clang-15+0x2c06b81)
#14 0x000055a3bc3fcafc llvm::legacy::PassManagerImpl::run(llvm::Module&) (/home/nathan/tmp/build/llvm-bisect/stage1/bin/clang-15+0x2bffafc)
#15 0x000055a3bd2fd16d clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream>>) (/home/nathan/tmp/build/llvm-bisect/stage1/bin/clang-15+0x3b0016d)
#16 0x000055a3bd6a27ee clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) CodeGenAction.cpp:0:0
#17 0x000055a3bdf46cb4 clang::ParseAST(clang::Sema&, bool, bool) (/home/nathan/tmp/build/llvm-bisect/stage1/bin/clang-15+0x4749cb4)
#18 0x000055a3bd5f0f50 clang::FrontendAction::Execute() (/home/nathan/tmp/build/llvm-bisect/stage1/bin/clang-15+0x3df3f50)
#19 0x000055a3bd565d1f clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/home/nathan/tmp/build/llvm-bisect/stage1/bin/clang-15+0x3d68d1f)
#20 0x000055a3bd69be92 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/home/nathan/tmp/build/llvm-bisect/stage1/bin/clang-15+0x3e9ee92)
#21 0x000055a3bb785028 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/home/nathan/tmp/build/llvm-bisect/stage1/bin/clang-15+0x1f88028)
#22 0x000055a3bb782f2f ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&) driver.cpp:0:0
#23 0x000055a3bd3ea372 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const::$_1>(long) Job.cpp:0:0
#24 0x000055a3bcad2837 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/home/nathan/tmp/build/llvm-bisect/stage1/bin/clang-15+0x32d5837)
#25 0x000055a3bd3e9ecf clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const (/home/nathan/tmp/build/llvm-bisect/stage1/bin/clang-15+0x3bececf)
#26 0x000055a3bd3aaa68 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&) const (/home/nathan/tmp/build/llvm-bisect/stage1/bin/clang-15+0x3bada68)
#27 0x000055a3bd3aad37 clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) const (/home/nathan/tmp/build/llvm-bisect/stage1/bin/clang-15+0x3badd37)
#28 0x000055a3bd3c5658 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/home/nathan/tmp/build/llvm-bisect/stage1/bin/clang-15+0x3bc8658)
#29 0x000055a3bb7828a2 main (/home/nathan/tmp/build/llvm-bisect/stage1/bin/clang-15+0x1f858a2)
#30 0x00007f4af313d550 __libc_start_call_main (/lib64/libc.so.6+0x29550)
#31 0x00007f4af313d609 __libc_start_main at GLIBC_2.2.5 (/lib64/libc.so.6+0x29609)
#32 0x000055a3bb77fe85 _start /build/glibc/src/glibc/csu/../sysdeps/x86_64/start.S:117:0
clang-15: error: clang frontend command failed with exit code 134 (use -v to see invocation)
ClangBuiltLinux clang version 15.0.0 (https://github.com/llvm/llvm-project c35ca3a1c78f693b749ad11742350b7fc6c5cd89)
Target: powerpc64le-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/nathan/tmp/build/llvm-bisect/stage1/bin
clang-15: note: diagnostic msg: Error generating preprocessed source(s) - no preprocessable inputs.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D125506/new/
https://reviews.llvm.org/D125506
More information about the cfe-commits
mailing list