Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Gentoo User (http://www.linux-archive.org/gentoo-user/)
-   -   gcc-4.3.x and Core 2 Duo, safe way (http://www.linux-archive.org/gentoo-user/103090-gcc-4-3-x-core-2-duo-safe-way.html)

Andrew Gaydenko 06-09-2008 03:47 AM

gcc-4.3.x and Core 2 Duo, safe way
 
gcc-4.3.1 is umasked now. I'm on ~amd64 with Core 2 Duo CPU. Is it
sufficient just to set

CFLAGS="-O2 -march=core2 -mtune=core2 -pipe"

instead of

CFLAGS="-O2 -march=native -mtune=native -pipe"

which I have in make.conf now? Are there any other things to do?


Andrew
--
gentoo-user@lists.gentoo.org mailing list

Graham Murray 06-09-2008 05:43 AM

gcc-4.3.x and Core 2 Duo, safe way
 
Andrew Gaydenko <a@gaydenko.com> writes:

> gcc-4.3.1 is umasked now. I'm on ~amd64 with Core 2 Duo CPU. Is it
> sufficient just to set
>
> CFLAGS="-O2 -march=core2 -mtune=core2 -pipe"
>
> instead of
>
> CFLAGS="-O2 -march=native -mtune=native -pipe"
>
> which I have in make.conf now? Are there any other things to do?

Should the two not be equivalent? On a core2 processor, should
-march=native not generate code for the core2?
--
gentoo-user@lists.gentoo.org mailing list

Andrew Gaydenko 06-09-2008 06:11 AM

gcc-4.3.x and Core 2 Duo, safe way
 
======= On Monday 09 June 2008, Graham Murray wrote: =======
> Andrew Gaydenko <a@gaydenko.com> writes:
> > gcc-4.3.1 is umasked now. I'm on ~amd64 with Core 2 Duo CPU. Is it
> > sufficient just to set
> >
> > CFLAGS="-O2 -march=core2 -mtune=core2 -pipe"
> >
> > instead of
> >
> > CFLAGS="-O2 -march=native -mtune=native -pipe"
> >
> > which I have in make.conf now? Are there any other things to do?
>
> Should the two not be equivalent? On a core2 processor, should
> -march=native not generate code for the core2?

I don't know - 'core2' flag is a 4.3.x invention :-)
--
gentoo-user@lists.gentoo.org mailing list

Justin 06-09-2008 07:17 AM

gcc-4.3.x and Core 2 Duo, safe way
 
Graham Murray schrieb:

Andrew Gaydenko <a@gaydenko.com> writes:


gcc-4.3.1 is umasked now. I'm on ~amd64 with Core 2 Duo CPU. Is it
sufficient just to set


CFLAGS="-O2 -march=core2 -mtune=core2 -pipe"

instead of

CFLAGS="-O2 -march=native -mtune=native -pipe"

which I have in make.conf now? Are there any other things to do?



Should the two not be equivalent? On a core2 processor, should
-march=native not generate code for the core2?

I can't remember where (but it could only be in the wiki or the official
gcc docs), I read that using -march="YOURARCH" should be preferred over
-march=native.

Robert Bridge 06-09-2008 01:33 PM

gcc-4.3.x and Core 2 Duo, safe way
 
On Mon, 09 Jun 2008 06:43:41 +0100
Graham Murray <graham@gmurray.org.uk> wrote:

> Andrew Gaydenko <a@gaydenko.com> writes:
>
> > gcc-4.3.1 is umasked now. I'm on ~amd64 with Core 2 Duo CPU. Is it
> > sufficient just to set
> >
> > CFLAGS="-O2 -march=core2 -mtune=core2 -pipe"
> >
> > instead of
> >
> > CFLAGS="-O2 -march=native -mtune=native -pipe"
> >
> > which I have in make.conf now? Are there any other things to do?
>
> Should the two not be equivalent? On a core2 processor, should
> -march=native not generate code for the core2?

If we are going to get picky about this, it should be noted the -march
implies -mtune, at least according to the gcc man pages, and I will
trust them to know.

I can't remember which will actually be implemented if both are
specified, but march is a essentially a stronger version of mtune which
breaks compatibility with other CPUs within the same ARCH type. (i.e.
march=pentium4 may not run on a pentium3, but should run faster than
mtune on a pentium4)

RobbieAB
--
gentoo-user@lists.gentoo.org mailing list


All times are GMT. The time now is 12:59 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.