Skip to content

Assertion failed: (DstReg != SrcReg && "SrcReg and DstReg cannot be the same") #27

Closed
@dylanmckay

Description

@dylanmckay

While compiling Rust libcore

I've got a (massive) testcase
libcore.ll. This is the entire Rust libcore as an LLVM IR program.

Reproduction

./bin/llc ~/libcore.ll -O0 -o /dev/null
Assertion failed: (DstReg != SrcReg && "SrcReg and DstReg cannot be the same"), function expand, file /Users/dylan/projects/llvm-project/llvm/lib/Target/AVR/AVRExpandPseudoInsts.cpp, line 590.
0  libLLVMSupport.dylib     0x0000000111c333ac llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 60
1  libLLVMSupport.dylib     0x0000000111c338f9 PrintStackTraceSignalHandler(void*) + 25
2  libLLVMSupport.dylib     0x0000000111c2fa29 llvm::sys::RunSignalHandlers() + 425
3  libLLVMSupport.dylib     0x0000000111c33c42 SignalHandler(int) + 354
4  libsystem_platform.dylib 0x00007fff925b6b3a _sigtramp + 26
5  libsystem_platform.dylib 0xffffffffffffffff _sigtramp + 1839502559
6  libsystem_c.dylib        0x00007fff9243b420 abort + 129
7  libsystem_c.dylib        0x00007fff92402893 basename_r + 0
8  libLLVMAVRCodeGen.dylib  0x000000010d4f73e5 bool (anonymous namespace)::AVRExpandPseudo::expand<184u>(llvm::MachineBasicBlock&, llvm::MachineInstrBundleIterator<llvm::MachineInstr, false>) + 277
9  libLLVMAVRCodeGen.dylib  0x000000010d4f4470 (anonymous namespace)::AVRExpandPseudo::expandMI(llvm::MachineBasicBlock&, llvm::MachineInstrBundleIterator<llvm::MachineInstr, false>) + 1184
10 libLLVMAVRCodeGen.dylib  0x000000010d4f3c7c (anonymous namespace)::AVRExpandPseudo::expandMBB(llvm::MachineBasicBlock&) + 316
11 libLLVMAVRCodeGen.dylib  0x000000010d4f36fa (anonymous namespace)::AVRExpandPseudo::runOnMachineFunction(llvm::MachineFunction&) + 298
12 libLLVMCodeGen.dylib     0x000000010ef26b51 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 449
13 libLLVMCore.dylib        0x000000010ff3679f llvm::FPPassManager::runOnFunction(llvm::Function&) + 399
14 libLLVMCore.dylib        0x000000010ff36ca5 llvm::FPPassManager::runOnModule(llvm::Module&) + 117
15 libLLVMCore.dylib        0x000000010ff37a74 (anonymous namespace)::MPPassManager::runOnModule(llvm::Module&) + 2196
16 libLLVMCore.dylib        0x000000010ff36f66 llvm::legacy::PassManagerImpl::run(llvm::Module&) + 342
17 libLLVMCore.dylib        0x000000010ff387a1 llvm::legacy::PassManager::run(llvm::Module&) + 33
18 llc                      0x0000000108b462b2 compileModule(char**, llvm::LLVMContext&) + 21810
19 llc                      0x0000000108b4017f main + 2447
20 libdyld.dylib            0x00007fff923a7235 start + 1
Stack dump:
0.      Program arguments: ./bin/llc /Users/dylan/libcore.ll -O0 -o /dev/null
1.      Running pass 'Function Pass Manager' on module '/Users/dylan/libcore.ll'.
2.      Running pass 'AVR pseudo instruction expansion pass' on function '@_ZN4core4sync6atomic11atomic_load17h9977d1b8983da2bdE'
[1]    55133 abort      ./bin/llc ~/libcore.ll -O0 -o /dev/null

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-libcoreAffects compiling the core libraryA-llvmAffects the LLVM AVR backendhas-llvm-commitThis issue should be fixed in upstream LLVM

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions