public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Florian Philipp <lists@binarywings.net>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] New computer and Gentoo
Date: Thu, 21 Jul 2011 11:56:33 +0200	[thread overview]
Message-ID: <4E27F7D1.1050404@binarywings.net> (raw)
In-Reply-To: <4E27EF91.4060408@binarywings.net>

[-- Attachment #1: Type: text/plain, Size: 2816 bytes --]

Am 21.07.2011 11:21, schrieb Florian Philipp:
> Am 21.07.2011 10:57, schrieb Pandu Poluan:
>> -original message-
>> Subject: Re: [gentoo-user] New computer and Gentoo
>> From: Bill Kenworthy <billk@iinet.net.au>
>> Date: 2011-07-21 12:54
>>
>>> On Thu, 2011-07-21 at 06:26 +0100, Mick wrote:
> [...]
>>> Ive just stumbled on something weird with march=native:
>>>
>>> At some point I had march=prescott on a core2 E4600 running 32bit -
>>> worked well.  Changed to march=native and did some upgrades with a few
>>> odd things like asterisk segfaulting in a glibc library afterwards, and
>>> some things not building.  Then to add confusion, I changed to an
>>> pentium Duo E6600 (flies!) and added another stick of ram.  More odd
>>> things happening such as reiserfs oopsing on shutdown.
>>>
>>> Last night the penny dropped and I looked the new processor up and
>>> changed to march=core2 and have mostly corrected (recompiled) the
>>> damage.
>>>
>>> So not sure about march=native now as it is only what was built with
>>> native thats been problematic.  With 20-20 hindsight it was perhaps
>>> predictable ...
>>
>> IMO you're not supposed to compile part of the system with -march=<something>
>> and the rest with -march=native. The instructions (and optimizations)
>> emitted by -march=native might not be compatible with your previous
>> -march.
> 
> I'd like to see a reference for this claim. -march=native doesn't do
> more than set -march=core2 and some other optimizations for cache size
> etc. This should be no more troublesome than mixing code compiled with
> different specific -march settings. When you look at binary
> distributions (and especially precompiled packages from the developer
> instead of the distribution), this is pretty much normal.
> 
> The compiler is not allowed to change the external interfaces of
> functions for optimization purposes (see [1]). Besides this, I can only
> think of alignment problems ([2]) but even this should be handled
> correctly by the compiler. Everything else is a compiler bug that should
> be reported.
> 
> [1] http://en.wikipedia.org/wiki/Calling_convention
> [2] http://en.wikipedia.org/wiki/Data_alignment
> 
> Regards,
> Florian Philipp
> 

I've just checked it by comparing the output of `gcc -v -Q -O2
-march=native test.c` with `gcc -v -Q -O2 -march=core2 test.c`:

-march=native is resolved to:
-march=core2 -mcx16 -msahf -mpopcnt -msse4.2 --param l1-cache-size=32
--param l1-cache-line-size=64 --param l2-cache-size=256 -mtune=core2

I also see that the -march=core2 version has the following options
enabled: -mno-sse4
whereas -march=native enabled: -mpopcnt -msse4 -msse4.1 -msse4.2

-mssse3 and lower SSE versions were enabled in both cases.

Regards,
Florian Philipp


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

  parent reply	other threads:[~2011-07-21  9:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-21  8:57 [gentoo-user] New computer and Gentoo Pandu Poluan
2011-07-21  9:21 ` Florian Philipp
2011-07-21  9:52   ` Pandu Poluan
2011-07-21  9:56   ` Florian Philipp [this message]
2011-07-21 13:10   ` William Kenworthy
2011-07-21 14:05     ` Florian Philipp
2011-07-23 13:40       ` Stroller
  -- strict thread matches above, loose matches on Subject: below --
2011-07-21  2:23 CJoeB
2011-07-21  2:29 ` Adam Carter
2011-07-21  5:26   ` Mick
2011-07-21  5:54     ` Bill Kenworthy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E27F7D1.1050404@binarywings.net \
    --to=lists@binarywings.net \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox