Talk:GCC optimization

From Gentoo Wiki
Jump to:navigation Jump to:search
Note
This is a Talk page - please see the documentation about using talk pages. Add newer comments below older ones, sign comments using four tildes (~~~~), and indent successive comments with colons (:). Add new sections at the bottom of the page, under a heading (== ==). Please remember to mark sections as "open for discussion" using {{talk|open}}, so they 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 done.

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)

A section about LTO has been added to the article. Fturco (talk) 14:07, 2 June 2020 (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)

Rename title to GCC/Optimization

Talk status
This discussion is still ongoing.

The wiki has GCC article and it would be consistent as a sub article. Gso321 (talk) 23:29, 9 May 2023 (UTC)