https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100347

--- Comment #14 from Iain Sandoe <iains at gcc dot gnu.org> ---
(In reply to Erik Schnetter from comment #13)
> The failing GCC 11.1.0 is built by Apple Clang 12.0.5 via Spack. Looking at
> debug output, I see that Spack inserts a "-march=skylake" command line
> option. (I was not aware of this before.) It does so by creating a compiler
> wrapper (called "clang++" as well), which calls the actual compiler and adds
> this (and some other) flags. 
> 
> I seem to recall having read somewhere that GCC's CPU detection code must be
> built without any "-march=..." flag.

well, the GCC config makes sensible default choices for CPU (if there's no
--with-cpu=) - which is core2 mostly (so that the code should run anywhere).

As of this moment the only machines I've got builds with --with-cpu= specify
the correct CPU for the machine, so -march= isn't going to tell anything -
except I can say for sure that it doesn't report x86_64):

/src-local/gcc-master/configure
--prefix=/opt/iains/x86_64-apple-darwin16/gcc-12-0-0d
--build=x86_64-apple-darwin16
--with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
--enable-languages=all --with-cpu=corei7 --with-tune=skylake
CC=x86_64-apple-darwin16-gcc CXX=x86_64-apple-darwin16-g++

$ ./gcc/xgcc -Bgcc -march=native -Q --help=target | grep march
  -march=                               skylake

So that's reporting what was configures, but also what would be correct for the
hardware - it hasn't overridden the configuration settings.

can we get the output of "gcc -v" for the compiler that isn't working?

If this is a compiler built without bootstrap, and the bootstrap compiler is
clang, then that could be an unknown quantity.  Production compilers should be
bootstrapped.

Reply via email to