Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 376357 - Improvement for gcc-optimization guide
Summary: Improvement for gcc-optimization guide
Status: RESOLVED NEEDINFO
Alias: None
Product: [OLD] Docs on www.gentoo.org
Classification: Unclassified
Component: Other documents (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Docs Team
URL: http://www.gentoo.org/doc/en/gcc-opti...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-25 13:30 UTC by Agostino Sarubbo
Modified: 2011-07-29 08:47 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2011-07-25 13:30:50 UTC
After new releases of gcc I noticed that -march option is changed if you use one of newer gcc.

My -march is changed from prescott to pentium-m and from core2 to corei7

So, in this guide is mentioned to use -march=native, if the user is not sure about his -march.
Imho is a good idea add a simple code to check own -march.

gcc -march=native -E -v - </dev/null 2>&1 | sed -n 's/.* -v - //p'

tells this information.
Comment 1 Jan Kundrát (RETIRED) gentoo-dev 2011-07-28 12:59:00 UTC
Hi Agostino, it isn't obvious to me what the benefits of such a code are. We already encourage users to use -march=native, so they won't gain anything by specifying the optimization target by hand. Please feel free to reopen and explain the matter in more detail if I got you wrong.
Comment 2 Matt Summers (RETIRED) gentoo-dev 2011-07-28 14:48:02 UTC
Hi there,

While I find -march=native to be rather handy form time to time, I think it hides any true understanding of what is actually occurring with the use of that particular switch. Therefore, I support Ago's request to add in an informational section regarding how a user might learn what 'native' actually means in the specific instance of use. Further, there has been discussion of the usefulness of this numerous times on the -dev (or -core cannot recall atm) MLs, and there exists a nice page on gentoo-wiki regarding how this can be useful. Finally, since we are talking about GCC optimization, I am strongly in favor of a more complete treatment of the various switches illuminated by the use of Ago's little one-liner (and other methods of achieving similar), like --param and how that can affect the optimization.

Thank you for your attention and kind consideration.

p.s. I would be delighted to help out with writing some of this, as I have quite a bit of material collected over the past several years. 

p.s.s. I also think a discussion of the consequences of using 'native' with respect to binpkg portability would be a boon to users as well.

p.s.s.s. As always, for a more in-depth and comprehensive treatment, we can point users to the GCC docs for the specific version they are interested in.

p.s.s.s.s. Ago, do you have a patch prepared? It might be handy to create one.

p.s.s.s.s.s. just kidding about yet another post script :-D
Comment 3 Jan Kundrát (RETIRED) gentoo-dev 2011-07-29 08:47:40 UTC
Hi Matt, could you please provide a few links to the relevant discussions? After you've done that, please don't forget to reopen this bug.