This is the mail archive of the
mailing list for the GCC project.
Re: docs. on -fno-guess-branch-probability
On Tuesday 07 May 2002 1:55 pm, mike stump wrote:
> > From: Dave Fladebo <email@example.com>
> > To: firstname.lastname@example.org
> > Date: Tue, 7 May 2002 13:26:33 -0500
> > I recently came across a section of the docs. for gcc that was initially
> > a bit confusing to me and would like to propose a change.
> > -fno-guess-branch-probability
> > Depending on other optimization switch settings and source code, gcc may
> > use built-in branch probability optimization heuristics when information
> > is not available from either profile directed feedback (`-fprofile-arcs')
> > or (`__built-in_expect'). In a hard real-time system, it may be highly
> > desirable that source code with the same logical result [e.g.: if(x <= y)
> > func1(); else func2(); changed to if(x > y) func2(); else func1();] cause
> > the generation of executable code that performs the same, minimizing the
> > possibility of differences being introduce by branch prediction
> > optimizations, even if this may result in slower runtime performance.
> > This switch instructs the compiler to not use the built-in branch
> > probability optimization heuristics.
> I think it is worse.
Ok - thanks for the feedback...
What am I missing or what do I have wrong?