Closed
Description
This (possibly invalid?) inline asm below segfaults the compiler:
#![feature(asm)]
unsafe fn _mm512_set1_epi64(a: i64) {
asm! {
"vpbroadcastq zmm0{k1}, $0"
:: "m"(a)
:: "intel"
}
}
fn main() {
unsafe { _mm512_set1_epi64(123); }
}
Rust version: rustc 1.40.0-nightly (1423bec 2019-11-05)
Backtrace
Thread 4 Crashed:
0 librustc_codegen_llvm-llvm.dylib 0x000000010ce1b74d llvm::X86ATTInstPrinter::getRegisterName(unsigned int) + 13
1 librustc_codegen_llvm-llvm.dylib 0x000000010cbfc97e llvm::X86AsmPrinter::PrintOperand(llvm::MachineInstr const*, unsigned int, llvm::raw_ostream&) + 270
2 librustc_codegen_llvm-llvm.dylib 0x000000010cbfd000 llvm::X86AsmPrinter::PrintIntelMemReference(llvm::MachineInstr const*, unsigned int, llvm::raw_ostream&) + 640
3 librustc_codegen_llvm-llvm.dylib 0x000000010cbfd5fb llvm::X86AsmPrinter::PrintAsmMemoryOperand(llvm::MachineInstr const*, unsigned int, char const*, llvm::raw_ostream&) + 59
4 librustc_codegen_llvm-llvm.dylib 0x000000010da9a65f llvm::AsmPrinter::EmitInlineAsm(llvm::MachineInstr const*) const + 1967
5 librustc_codegen_llvm-llvm.dylib 0x000000010da8ad96 llvm::AsmPrinter::EmitFunctionBody() + 3254
6 librustc_codegen_llvm-llvm.dylib 0x000000010cbfbe78 llvm::X86AsmPrinter::runOnMachineFunction(llvm::MachineFunction&) + 296
7 librustc_codegen_llvm-llvm.dylib 0x000000010dc0ecd9 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 281
8 librustc_codegen_llvm-llvm.dylib 0x000000010e4a2a88 llvm::FPPassManager::runOnFunction(llvm::Function&) + 808
9 librustc_codegen_llvm-llvm.dylib 0x000000010e4a2de3 llvm::FPPassManager::runOnModule(llvm::Module&) + 131
10 librustc_codegen_llvm-llvm.dylib 0x000000010e4a3229 llvm::legacy::PassManagerImpl::run(llvm::Module&) + 857
11 librustc_codegen_llvm-llvm.dylib 0x000000010cbdaae2 LLVMRustWriteOutputFile + 562
12 librustc_codegen_llvm-llvm.dylib 0x000000010cb8d4e6 rustc_codegen_llvm::back::write::write_output_file::hf57707ffdc6e18f0 (.llvm.4680699105796709659) + 86
13 librustc_codegen_llvm-llvm.dylib 0x000000010ca95e19 rustc_codegen_llvm::back::write::codegen::_$u7b$$u7b$closure$u7d$$u7d$::h1e2284aa1f07df86 (.llvm.14548906211475689160) + 1225
14 librustc_codegen_llvm-llvm.dylib 0x000000010ca945b3 rustc::util::common::time_ext::h484a300a27ce3e24 + 163
15 librustc_codegen_llvm-llvm.dylib 0x000000010cb9cc55 _$LT$rustc_codegen_llvm..LlvmCodegenBackend$u20$as$u20$rustc_codegen_ssa..traits..write..WriteBackendMethods$GT$::codegen::ha65c2290ec2d1389 + 3317
16 librustc_codegen_llvm-llvm.dylib 0x000000010cabefa2 std::sys_common::backtrace::__rust_begin_short_backtrace::h4b331c6d068dc9d3 + 3746
17 librustc_codegen_llvm-llvm.dylib 0x000000010cac02fb std::panicking::try::do_call::h721f6a3e03c50e53 (.llvm.15542101850647140514) + 43
18 libstd-cd43daae2cf7ddf1.dylib 0x0000000107be6d1f __rust_maybe_catch_panic + 31
19 librustc_codegen_llvm-llvm.dylib 0x000000010caa5156 core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::h125a629455a19778 + 134
20 libstd-cd43daae2cf7ddf1.dylib 0x0000000107bb8a0e _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::h9b41d7adac010663 + 62
21 libstd-cd43daae2cf7ddf1.dylib 0x0000000107be5a5e std::sys::unix::thread::Thread::new::thread_start::h0725fe9398379348 + 142
22 libsystem_pthread.dylib 0x00007fff68993d76 _pthread_start + 125
23 libsystem_pthread.dylib 0x00007fff689905d7 thread_start + 15
Metadata
Metadata
Assignees
Labels
Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Inline assembly (`asm!(…)`)Category: This is a bug.Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.Relevant to the compiler team, which will review and decide on the PR/issue.ICE tracked in rust-lang/glacier.This issue requires a nightly compiler in some way.