This is the mail archive of the
mailing list for the GCC project.
Re: docs. on -fno-guess-branch-probability
- From: mike stump <mrs at windriver dot com>
- To: dfladebo at starband dot net, gcc at gcc dot gnu dot org
- Date: Tue, 7 May 2002 11:55:20 -0700 (PDT)
- Subject: Re: docs. on -fno-guess-branch-probability
- References: <email@example.com>
> From: Dave Fladebo <firstname.lastname@example.org>
> To: email@example.com
> 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.
> 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.