Closed
Description
This is a weird issue that seems to only affect optimized builds.
Building this with nightly via rustc -C target-cpu=knl -O src\main.rs
produces errors, however this does not stop compilation and allows an executable to be produced. The resultant executable appears to be correct as to what is expected.
Building with rustc -C target-cpu=knl src\main.rs
(no optimizations) prints no errors and works as expected.
Tested on x86_64-pc-windows-msvc and x86_64-unknown-linux-gnu systems running rustc 1.27.0-nightly (f9bfe840f 2018-05-05)
#![feature(global_asm)]
/// This triggers an error from the compiler (assembler?)
/// however it does not seem to be fatal enough to stop
/// the program from building. This error only occurs with
/// optimizations enabled
///
/// C:\dev\rust_test>rustc -C target-cpu=knl -O src\main.rs
/// error: instruction requires: AVX-512 ISA
/// kmovw k3, eax
/// ^
/// error: instruction requires: AVX-512 ISA
/// kmovw k3, eax
/// ^
///
/// C:\dev\rust_test>rustc -C target-cpu=knl src\main.rs
///
/// C:\dev\rust_test>rustc -V
/// rustc 1.27.0-nightly (f9bfe840f 2018-05-05)
global_asm!(r#"
.intel_syntax
kmovw k3, eax
.att_syntax
"#);
fn main() {}