[llvm-bugs] [Bug 45580] New: riscv64 Linux kernel's allyesconfig fails to build after 5d73f79c54788

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Apr 16 16:53:26 PDT 2020


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

            Bug ID: 45580
           Summary: riscv64 Linux kernel's allyesconfig fails to build
                    after 5d73f79c54788
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: MC
          Assignee: unassignedbugs at nondot.org
          Reporter: natechancellor at gmail.com
                CC: llvm-bugs at lists.llvm.org

$ make -j$(nproc) -s ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu-
LD=riscv64-linux-gnu-ld LLVM=1 LLVM_IAS=1 O=out/riscv64 distclean allyesconfig
all
...
clang:
/home/nathan/cbl/git/tc-build/llvm-project/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCCodeEmitter.cpp:265:
unsigned int (anonymous namespace)::RISCVMCCodeEmitter::getImmOpValue(const
llvm::MCInst &, unsigned int, SmallVectorImpl<llvm::MCFixup> &, const
llvm::MCSubtargetInfo &) const: Assertion `MO.isExpr() && "getImmOpValue
expects only expressions or immediates"' 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: clang -Wp,-MD,crypto/.jitterentropy.o.d -nostdinc
-isystem /tmp/tmp.AN5nkMuk3h/llvm-bad/lib/clang/11.0.0/include
-I/home/nathan/src/linux/arch/riscv/include -I./arch/riscv/include/generated
-I/home/nathan/src/linux/include -I./include
-I/home/nathan/src/linux/arch/riscv/include/uapi
-I./arch/riscv/include/generated/uapi -I/home/nathan/src/linux/include/uapi
-I./include/generated/uapi -include
/home/nathan/src/linux/include/linux/kconfig.h -include
/home/nathan/src/linux/include/linux/compiler_types.h -D__KERNEL__
-Qunused-arguments -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs
-fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE
-Werror=implicit-function-declaration -Werror=implicit-int -Wno-format-security
-std=gnu89 --target=riscv64-linux-gnu
--prefix=/home/nathan/cbl/toolchains/binutils/bin/
--gcc-toolchain=/home/nathan/cbl/toolchains/binutils-20200416-0232-aec72fda3b320c36eb99fc1c4cf95b10fc026729
-Werror=unknown-warning-option -mabi=lp64 -march=rv64imac -mno-save-restore
-DCONFIG_PAGE_OFFSET=0xffffffe000000000 -mcmodel=medany -fno-omit-frame-pointer
-fno-delete-null-pointer-checks -Wno-frame-address
-Wno-address-of-packed-member -O2 -Wframe-larger-than=2048 -fno-stack-protector
-Wno-format-invalid-specifier -Wno-gnu -mno-global-merge
-Wno-unused-const-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls
-ftrivial-auto-var-init=pattern -pg -Wdeclaration-after-statement -Wvla
-Wno-pointer-sign -fno-strict-overflow -fno-merge-all-constants
-fno-stack-check -Werror=date-time -Werror=incompatible-pointer-types
-fmacro-prefix-map=/home/nathan/src/linux/= -Wno-initializer-overrides
-Wno-format -Wno-sign-compare -Wno-format-zero-length -Wno-pointer-to-enum-cast
-Wno-tautological-constant-out-of-range-compare -O0 -fno-builtin -I
/home/nathan/src/linux/crypto -I ./crypto
-DKBUILD_MODFILE="crypto/jitterentropy_rng" -DKBUILD_BASENAME="jitterentropy"
-DKBUILD_MODNAME="jitterentropy_rng" -c -o crypto/jitterentropy.o
/home/nathan/src/linux/crypto/jitterentropy.c
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module
'/home/nathan/src/linux/crypto/jitterentropy.c'.
4.      Running pass 'RISCV Assembly Printer' on function '@jent_read_entropy'
 #0 0x0000000002635d34 PrintStackTraceSignalHandler(void*)
(/tmp/tmp.AN5nkMuk3h/llvm-bad/bin/clang-11+0x2635d34)
 #1 0x0000000002633b0e llvm::sys::RunSignalHandlers()
(/tmp/tmp.AN5nkMuk3h/llvm-bad/bin/clang-11+0x2633b0e)
 #2 0x0000000002634fbd llvm::sys::CleanupOnSignal(unsigned long)
(/tmp/tmp.AN5nkMuk3h/llvm-bad/bin/clang-11+0x2634fbd)
 #3 0x00000000025cc923 (anonymous
namespace)::CrashRecoveryContextImpl::HandleCrash(int, unsigned long)
(/tmp/tmp.AN5nkMuk3h/llvm-bad/bin/clang-11+0x25cc923)
 #4 0x00000000025cca5c CrashRecoverySignalHandler(int)
(/tmp/tmp.AN5nkMuk3h/llvm-bad/bin/clang-11+0x25cca5c)
 #5 0x00007f99dba88890 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x12890)
 #6 0x00007f99da75be97 raise (/lib/x86_64-linux-gnu/libc.so.6+0x3ee97)
 #7 0x00007f99da75d801 abort (/lib/x86_64-linux-gnu/libc.so.6+0x40801)
 #8 0x00007f99da74d39a (/lib/x86_64-linux-gnu/libc.so.6+0x3039a)
 #9 0x00007f99da74d412 (/lib/x86_64-linux-gnu/libc.so.6+0x30412)
#10 0x00000000016758b1 (anonymous
namespace)::RISCVMCCodeEmitter::getImmOpValue(llvm::MCInst const&, unsigned
int, llvm::SmallVectorImpl<llvm::MCFixup>&, llvm::MCSubtargetInfo const&) const
(/tmp/tmp.AN5nkMuk3h/llvm-bad/bin/clang-11+0x16758b1)
#11 0x0000000001674e72 (anonymous
namespace)::RISCVMCCodeEmitter::getBinaryCodeForInstr(llvm::MCInst const&,
llvm::SmallVectorImpl<llvm::MCFixup>&, llvm::MCSubtargetInfo const&) const
(/tmp/tmp.AN5nkMuk3h/llvm-bad/bin/clang-11+0x1674e72)
#12 0x0000000001672ec1 (anonymous
namespace)::RISCVMCCodeEmitter::encodeInstruction(llvm::MCInst const&,
llvm::raw_ostream&, llvm::SmallVectorImpl<llvm::MCFixup>&,
llvm::MCSubtargetInfo const&) const
(/tmp/tmp.AN5nkMuk3h/llvm-bad/bin/clang-11+0x1672ec1)
#13 0x000000000231e1b7 llvm::MCELFStreamer::EmitInstToData(llvm::MCInst const&,
llvm::MCSubtargetInfo const&)
(/tmp/tmp.AN5nkMuk3h/llvm-bad/bin/clang-11+0x231e1b7)
#14 0x000000000232d4ce llvm::MCObjectStreamer::emitInstructionImpl(llvm::MCInst
const&, llvm::MCSubtargetInfo const&)
(/tmp/tmp.AN5nkMuk3h/llvm-bad/bin/clang-11+0x232d4ce)
#15 0x000000000232d333 llvm::MCObjectStreamer::emitInstruction(llvm::MCInst
const&, llvm::MCSubtargetInfo const&)
(/tmp/tmp.AN5nkMuk3h/llvm-bad/bin/clang-11+0x232d333)
#16 0x0000000001618c39 (anonymous
namespace)::RISCVAsmPrinter::emitInstruction(llvm::MachineInstr const*)
(/tmp/tmp.AN5nkMuk3h/llvm-bad/bin/clang-11+0x1618c39)
#17 0x0000000003164731 llvm::AsmPrinter::emitFunctionBody()
(/tmp/tmp.AN5nkMuk3h/llvm-bad/bin/clang-11+0x3164731)
#18 0x0000000001618573 (anonymous
namespace)::RISCVAsmPrinter::runOnMachineFunction(llvm::MachineFunction&)
(/tmp/tmp.AN5nkMuk3h/llvm-bad/bin/clang-11+0x1618573)
#19 0x0000000001c2363e
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
(/tmp/tmp.AN5nkMuk3h/llvm-bad/bin/clang-11+0x1c2363e)
#20 0x0000000002007c64 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/tmp/tmp.AN5nkMuk3h/llvm-bad/bin/clang-11+0x2007c64)
#21 0x0000000002007f58 llvm::FPPassManager::runOnModule(llvm::Module&)
(/tmp/tmp.AN5nkMuk3h/llvm-bad/bin/clang-11+0x2007f58)
#22 0x0000000002008684 llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/tmp/tmp.AN5nkMuk3h/llvm-bad/bin/clang-11+0x2008684)
#23 0x0000000002818d4a 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> >)
(/tmp/tmp.AN5nkMuk3h/llvm-bad/bin/clang-11+0x2818d4a)
#24 0x0000000002fdb8ad
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/tmp/tmp.AN5nkMuk3h/llvm-bad/bin/clang-11+0x2fdb8ad)
#25 0x000000000367fa43 clang::ParseAST(clang::Sema&, bool, bool)
(/tmp/tmp.AN5nkMuk3h/llvm-bad/bin/clang-11+0x367fa43)
#26 0x0000000002f43d70 clang::FrontendAction::Execute()
(/tmp/tmp.AN5nkMuk3h/llvm-bad/bin/clang-11+0x2f43d70)
#27 0x0000000002ea3ea3
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/tmp/tmp.AN5nkMuk3h/llvm-bad/bin/clang-11+0x2ea3ea3)
#28 0x0000000002fd57f4
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/tmp/tmp.AN5nkMuk3h/llvm-bad/bin/clang-11+0x2fd57f4)
#29 0x000000000160dab5 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/tmp/tmp.AN5nkMuk3h/llvm-bad/bin/clang-11+0x160dab5)
#30 0x000000000160bb9c ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
(/tmp/tmp.AN5nkMuk3h/llvm-bad/bin/clang-11+0x160bb9c)
#31 0x0000000002d6d642 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)
(/tmp/tmp.AN5nkMuk3h/llvm-bad/bin/clang-11+0x2d6d642)
#32 0x00000000025cc841
llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>)
(/tmp/tmp.AN5nkMuk3h/llvm-bad/bin/clang-11+0x25cc841)
#33 0x0000000002d6cc5d
clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
>, std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >*, bool*) const
(/tmp/tmp.AN5nkMuk3h/llvm-bad/bin/clang-11+0x2d6cc5d)
#34 0x0000000002d3b1ab
clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&,
clang::driver::Command const*&) const
(/tmp/tmp.AN5nkMuk3h/llvm-bad/bin/clang-11+0x2d3b1ab)
#35 0x0000000002d3b59a
clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const
(/tmp/tmp.AN5nkMuk3h/llvm-bad/bin/clang-11+0x2d3b59a)
#36 0x0000000002d522d8
clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&)
(/tmp/tmp.AN5nkMuk3h/llvm-bad/bin/clang-11+0x2d522d8)
#37 0x000000000160b5eb main
(/tmp/tmp.AN5nkMuk3h/llvm-bad/bin/clang-11+0x160b5eb)
#38 0x00007f99da73eb97 __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x21b97)
#39 0x0000000001608aaa _start
(/tmp/tmp.AN5nkMuk3h/llvm-bad/bin/clang-11+0x1608aaa)
clang-11: error: clang frontend command failed due to signal (use -v to see
invocation)
ClangBuiltLinux clang version 11.0.0 (git://github.com/llvm/llvm-project
5d73f79c54788bc07dabe9ed75c36f12bafe9d28)
Target: riscv64-unknown-linux-gnu
Thread model: posix
InstalledDir: /tmp/tmp.AN5nkMuk3h/llvm-bad/bin
...


creduce spits out:

a() {
  if (a)
    ;
}

This is related to that particular file using -O0
(https://github.com/torvalds/linux/commit/dfc9fa91938bd0cd5597a3da33d613986149a1e6).

Full preprocessed source and interestingness test available at
https://github.com/nathanchance/creduce-files/tree/5933b4a47563579c3d50803f5a886a935c6cdf6e/riscv64-crash-5d73f79c54788

-- 
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/20200416/3519e912/attachment-0001.html>


More information about the llvm-bugs mailing list