Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Impossible reg-to-reg copy when returning a zeroed 40-bit struct #170

Open
shepmaster opened this issue Jun 14, 2020 · 0 comments
Open

Impossible reg-to-reg copy when returning a zeroed 40-bit struct #170

shepmaster opened this issue Jun 14, 2020 · 0 comments
Labels
A-libcore Affects compiling the core library A-llvm Affects the LLVM AVR backend has-reduced-testcase A small LLVM IR file exists that demonstrates the problem

Comments

@shepmaster
Copy link
Member

target datalayout = "e-P1-p:16:8-i8:8-i16:8-i32:8-i64:8-f32:8-f64:8-n8-a:8"
target triple = "avr-unknown-unknown"

define hidden { i8, i32 } @"extract_sign"(i32 %self) unnamed_addr addrspace(1) {
start:
  ret { i8, i32 } zeroinitializer
}
llc -march=avr -mcpu=atmega328p -filetype=obj ./small.ll

Impossible reg-to-reg copy
UNREACHABLE executed at /Users/shep/Projects/rust/src/llvm-project/llvm/lib/Target/AVR/AVRInstrInfo.cpp:74!
Stack dump:
0.	Program arguments: llc -march=avr -mcpu=atmega328p -filetype=obj ./small.ll
1.	Running pass 'Function Pass Manager' on module './small.ll'.
2.	Running pass 'Post-RA pseudo instruction expansion pass' on function '@extract_sign'
0  libLLVM.dylib            0x000000011694ca58 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
1  libLLVM.dylib            0x000000011694bae5 llvm::sys::RunSignalHandlers() + 85
2  libLLVM.dylib            0x000000011694d036 SignalHandler(int) + 262
3  libsystem_platform.dylib 0x00007fff6e8af5fd _sigtramp + 29
4  libsystem_platform.dylib 0x000000000000004f _sigtramp + 18446603338661562991
5  libsystem_c.dylib        0x00007fff6e785808 abort + 120
6  libLLVM.dylib            0x0000000118d8461e llvm::llvm_unreachable_internal(char const*, char const*, unsigned int) + 462
7  libLLVM.dylib            0x0000000118c3e161 llvm::AVRInstrInfo::copyPhysReg(llvm::MachineBasicBlock&, llvm::MachineInstrBundleIterator<llvm::MachineInstr, false>, llvm::DebugLoc const&, llvm::MCRegister, llvm::MCRegister, bool) const + 993
8  libLLVM.dylib            0x0000000116b74b1e (anonymous namespace)::ExpandPostRA::runOnMachineFunction(llvm::MachineFunction&) + 2894
9  libLLVM.dylib            0x0000000116c5bbbd llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 349
10 libLLVM.dylib            0x0000000116a7cc08 llvm::FPPassManager::runOnFunction(llvm::Function&) + 1064
11 libLLVM.dylib            0x0000000116a7cec8 llvm::FPPassManager::runOnModule(llvm::Module&) + 72
12 libLLVM.dylib            0x0000000116a7d3be llvm::legacy::PassManagerImpl::run(llvm::Module&) + 1022
13 llc                      0x000000010fbbbebd compileModule(char**, llvm::LLVMContext&) + 8909
14 llc                      0x000000010fbb970c main + 1516
15 libdyld.dylib            0x00007fff6e6b6cc9 start + 1
% llvm-config --version
10.0.1-rust-dev

Rust commit f4fbb93

@shepmaster shepmaster added A-libcore Affects compiling the core library A-llvm Affects the LLVM AVR backend has-reduced-testcase A small LLVM IR file exists that demonstrates the problem labels Jun 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-libcore Affects compiling the core library A-llvm Affects the LLVM AVR backend has-reduced-testcase A small LLVM IR file exists that demonstrates the problem
Projects
None yet
Development

No branches or pull requests

1 participant