[MacPorts] #54771: gcc7 -march=native fails on compile for corei7
MacPorts
noreply at macports.org
Thu Sep 7 02:08:27 UTC 2017
#54771: gcc7 -march=native fails on compile for corei7
---------------------+-------------------
Reporter: bdmckay | Owner:
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version: 2.4.1
Keywords: | Port: gcc7
---------------------+-------------------
%% /opt/local/bin/gcc-mp-7 -v
{{{
Using built-in specs.
COLLECT_GCC=gcc7
COLLECT_LTO_WRAPPER=/opt/local/libexec/gcc/x86_64-apple-darwin16/7.2.0
/lto-wrapper
Target: x86_64-apple-darwin16
Configured with:
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_lang_gcc7/gcc7/work/gcc-7.2.0/configure
--prefix=/opt/local --build=x86_64-apple-darwin16 --enable-
languages=c,c++,objc,obj-c++,lto,fortran --libdir=/opt/local/lib/gcc7
--includedir=/opt/local/include/gcc7 --infodir=/opt/local/share/info
--mandir=/opt/local/share/man --datarootdir=/opt/local/share/gcc-7 --with-
local-prefix=/opt/local --with-system-zlib --disable-nls --program-
suffix=-mp-7 --with-gxx-include-dir=/opt/local/include/gcc7/c++/ --with-
gmp=/opt/local --with-mpfr=/opt/local --with-mpc=/opt/local --with-
isl=/opt/local --enable-stage1-checking --disable-multilib --enable-lto
--enable-libstdcxx-time --with-build-config=bootstrap-debug --with-
as=/opt/local/bin/as --with-ld=/opt/local/bin/ld --with-
ar=/opt/local/bin/ar --with-bugurl=https://trac.macports.org/newticket
--disable-tls --with-pkgversion='MacPorts gcc7 7.2.0_0'
Thread model: posix
gcc version 7.2.0 (MacPorts gcc7 7.2.0_0)
}}}
%% cat basic.c
{{{
#include <stdio.h>
int main()
{
double t;
long int q;
scanf("%ld",&q);
t = q;
printf("t = %f\n",t);
return 0;
}
}}}
%% /opt/local/bin/gcc-mp-7 -c -march=native basic.c
{{{
/var/folders/vc/6bfn_k1j1bgbls8f6xg0pn8h0000gq/T//ccIvauBW.s:21:no such
instruction: `vcvtsi2sdq %rax, %xmm0,%xmm0'
/var/folders/vc/6bfn_k1j1bgbls8f6xg0pn8h0000gq/T//ccIvauBW.s:22:no such
instruction: `vmovsd %xmm0, -8(%rbp)'
/var/folders/vc/6bfn_k1j1bgbls8f6xg0pn8h0000gq/T//ccIvauBW.s:24:no such
instruction: `vmovd %rax, %xmm0'
}}}
Comments: The hardware is a MacBook Pro, 13in Late 2012, 2.9 GHz Intel
Core i7 processor.
The instruction vcvtsi2sdq is in the AVX2 set, which corei7 does not
support, so it should not be authorized by "-march=native". The i/o
statements in the test program are just to prevent the compiler from
optimizing away the type conversion; otherwise they don't seem relevant.
The error goes away if "-march=native" is replaced by "-march=corei7" or
replaced by "-march=native -mno-avx". The same problems occurred for gcc
7.1.1. Apologies if this is not macports-specific; I don't have an easy
way to tell. If there is a better place to report this, please let me
know.
--
Ticket URL: <https://trac.macports.org/ticket/54771>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list