Talk:GCC optimization

From Gentoo Wiki
Jump to: navigation, search
Note
This is a talk page. Please add newer comments below older ones, and sign your comments using four tildes (~~~~). When adding a new section (at the bottom of the page), please mark it as "open for discussion" by using {{talk|open}} so it will show up in the list of open discussions.

Suggestions about where to link new users

Talk status
This discussion is done as of May 11, 2017.

I find this page very instructive, and I just want to share/discuss a couple observations about the evolution of this advice.

First, it seems that this page is intended to serve users at both beginner (it takes the time to explain what CFLAGS are) and advanced (it is aimed at optimization and warns of unintended consequences of failed attempts at optimization) levels of familiarity with the subject.

Second, I note that the Handbook now refers all users to the gnu gcc manual (which, though great background, is not focused on the task at hand during the installation process). So, the Handbook also refers all users to this page, whereas I think it used to refer users to Safe_CFLAGS instead of this.

Comparing this page with the Safe_CFLAGS page, I see that there is different advice about how to get gcc to tell you what CFLAGS you should set.

Recommendation: perhaps, if the Safe_CFLAGS page is relevant, some of the less familiar users would be better served by it than the more detailed discussion on this page, and we could include in this page a reference to the Safe_CFLAGS page.

See also this forum discussion. brendlefly62 (talk) 17:59, 23 January 2017 (UTC)

Thanks for the effort you put into writing this up. I'll check into where we're currently linking new users and try to make our linking ideal. Kind regards, --Maffblaster (talk) 22:47, 11 May 2017 (UTC)

What about -flto?

Talk status
This discussion is still ongoing as of 2017-08-06.

The page doesn't say anything about link-time optimization or the -flto flag. I was looking at the optimization flags in the GCC manual and it looked pretty important, so I'm surprised this page doesn't have any advice about whether/how it should be used in Gentoo.Nlburgin (talk) 23:05, 6 August 2017 (UTC)

Optimizations equal or greater than 3

Talk status
This discussion is done.

I can no longer find the following piece of code in gcc/opts.c:

CODE -O source code
if (optimize >= 3)
    {
      flag_inline_functions = 1;
      flag_unswitch_loops = 1;
      flag_gcse_after_reload = 1;
      /* Allow even more virtual operators.  */
      set_param_value ("max-aliased-vops", 1000);
      set_param_value ("avg-aliased-vops", 3);
    }

Should we remove it from the article?

Fturco (talk) 16:21, 7 August 2018 (UTC)

Updated. --Grknight (talk) 02:33, 8 November 2018 (UTC)