I noticed -fprofile-generate and -fprofile-use dont have an up to date summary of the options they enable. Patch follows.
Created attachment 9411 [details] Update profile option documentation Document all options that -fprofile-generate/-fprofile-usr select: -fprofile-generate selects -fspeculative-prefetching -fprofile-use selects -fprofile-values and -fspeculative-prefetching I noticed -fprofile-generate does select -funroll-loops but I dont know why it does (so didnt document it)
Subject: Re: Improve documentation on -fprofile-generate, -fprofile-use On Aug 2, 2005, at 10:25 AM, anton at samba dot org wrote: > > ------- Additional Comments From anton at samba dot org 2005-08-02 > 14:25 ------- > Created an attachment (id=9411) > --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=9411&action=view) > Update profile option documentation > > Document all options that -fprofile-generate/-fprofile-usr select: > > -fprofile-generate selects -fspeculative-prefetching > -fprofile-use selects -fprofile-values and -fspeculative-prefetching No use/generate does not select -fspeculative-prefetching. The code to select it was disabled. > I noticed -fprofile-generate does select -funroll-loops but I dont > know why it > does (so didnt document it) The reason why it turns on -funroll-loops is because unrolling happens before profiling is done. Though that was only true in 4.0.x. -- Pinski
Created attachment 9414 [details] Updated patch As pinskia pointed out, -fspeculative-prefetching is not selected.
Confirmed, please send the patch to gcc-patches@ with a change log.
Author: sandra Date: Sat Nov 17 00:53:17 2018 New Revision: 266231 URL: https://gcc.gnu.org/viewcvs?rev=266231&root=gcc&view=rev Log: 2018-11-16 Sandra Loosemore <sandra@codesourcery.com> PR middle-end/23197 gcc/ * doc/invoke.texi (Optimize Options): Update options enabled by fprofile-generate, -fprofile-use, and -fauto-profile. Modified: trunk/gcc/ChangeLog trunk/gcc/doc/invoke.texi
This is (finally) fixed on trunk. The code has changed so much over the last 13 years that the attached patch was not helpful, so I went through opts.c and made sure the documentation matches the code. I also fixed -fauto-profile, which shares most of the same logic as -fprofile-use.