This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: "-march=native" possibly being misled on Debian i386?
- From: Toby Douglass <toby dot douglass at minodes dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Sun, 11 Jun 2017 16:30:48 +0200
- Subject: Re: "-march=native" possibly being misled on Debian i386?
- Authentication-results: sourceware.org; auth=none
- References: <CAP7A1kHCjnKwU6i2+TO2MDZekfsbQ=a_4BreHy8g+QjPbEa2CA@mail.gmail.com> <1497180809.2077.19.camel@stu.xidian.edu.cn>
I wrote:
> Using the OS GCC (4.9.2, native build for i586-linux-gnu);
> WIthout, I get arch i586, tune generic.
> With, I get - ha! - "-march=native", and no tune.
This seems odd.
A bit more information now, pairs of command/output.
First on Debian 8, the OS provided 4.9.2 on my normal x86_64 machine.
gcc -E -x c /dev/null -v
COLLECT_GCC_OPTIONS='-E' '-v' '-mtune=generic' '-march=x86-64'
gcc -march=native -E -x c /dev/null -v
COLLECT_GCC_OPTIONS='-march=native' '-E' '-v'
gcc -mtune=native -E -x c /dev/null -v
COLLECT_GCC_OPTIONS='-mtune=native' '-E' '-v' '-march=x86-64'
gcc -march=native -mtune=native -E -x c /dev/null -v
COLLECT_GCC_OPTIONS='-march=native' '-mtune=native' '-E' '-v'
Interetin', eh? tune is doing something, even though arch isn't.
Going back to the version 1 Minnowboard (Atom E640), Debian 8, the OS
provided GCC 4.9.2;
gcc -E -x c /dev/null -v
COLLECT_GCC_OPTIONS='-E' '-v' '-mtune=generic' '-march=i586'
gcc -march=native -E -x c /dev/null -v
COLLECT_GCC_OPTIONS='-march=native' '-E' '-v'
gcc -mtune=native -E -x c /dev/null -v
COLLECT_GCC_OPTIONS='-mtune=native' '-E' '-v' '-march=i586'
gcc -march=native -mtune=native -E -x c /dev/null -v
COLLECT_GCC_OPTIONS='-march=native' '-mtune=native' '-E' '-v'
Superficially at least, -march is looking a bit messed up. However,
it's more likely my expectation of what it is does is amiss =-)