https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91652
Bug ID: 91652
Summary: -march=skylake-avx512 -mno-fma -O2 generates FMA
instructions
Product: gcc
Version: 9.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: joseph.weening at gmail dot com
Target Milestone: ---
Created attachment 46807
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46807&action=edit
program to demonstrate generation of FMA instructions
On x86_64, compiling C code with -march=skylake-avx512 -mno-fma -O2 generates
FMA instructions. (-mno-fma works correctly with -march=skylake or
-march=haswell.)
The attached program demonstrates the problem. It prints "d is 0.000000" when
not using FMA, and "d is -1.000000" when using FMA.
% gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/var/tmp/gcc/libexec/gcc/x86_64-pc-linux-gnu/9.2.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-9.2.0/configure --prefix=/var/tmp/gcc
--disable-multilib --enable-languages=c --with-gmp=/usr/local/gmp/6.1.2
--with-mpfr=/usr/local/mpfr/4.0.1 --with-mpc=/usr/local/mpc/1.1.0
Thread model: posix
gcc version 9.2.0 (GCC)
Command to demonstrate the bug:
% gcc -march=skylake-avx512 -mno-fma -O2 fmabug.i && a.out
Compiler errors, warnings:
(none)