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.
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.
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
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.