This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: disabling branch probability guessing (patch)
- To: Mark Mitchell <mark at codesourcery dot com>
- Subject: Re: disabling branch probability guessing (patch)
- From: Aldy Hernandez <aldyh at redhat dot com>
- Date: Wed, 17 Jan 2001 08:52:24 -0400
- Cc: law at redhat dot com, rth at redhat dot com, gcc-patches at gcc dot gnu dot org, wilson at redhat dot com
- References: <20010116100032.A1243@redhat.com> <20010116224841I.mitchell@codesourcery.com>
On Tue, Jan 16, 2001 at 10:48:41PM -0800, Mark Mitchell wrote:
>
> Thanks for posting this; it's a good summary, and sound logic.
>
> I think it would be useful to have an even briefer summary in the
> code or info pages. Something like:
>
> In a hard real-time system, people don't want different
> runs of the compiler to produce code that has different behavior;
> minimizing non-determinism is of paramount import. This switch
> allows users to reduce non-determinism, possibly at the expense
> of inferior optimization.
>
> Would you mind correcting and adding that somewhere?
not at all.
here is the updated patch. I added your description to the info page.
i assume this is ok.
aldy
2001-01-16 Aldy Hernandez <aldyh@redhat.com>
* sourceware/gcc/gcc/invoke.texi (-fno-guess-branch-probability):
New option.
Index: invoke.texi
===================================================================
RCS file: /cvs/gcc/egcs/gcc/invoke.texi,v
retrieving revision 1.262
diff -c -r1.262 invoke.texi
*** invoke.texi 2001/01/11 18:37:17 1.262
--- invoke.texi 2001/01/17 12:49:53
***************
*** 249,255 ****
-finline-functions -finline-limit=@var{n} -fkeep-inline-functions
-fkeep-static-consts -fmove-all-movables
-fno-default-inline -fno-defer-pop
! -fno-function-cse -fno-inline -fno-math-errno -fno-peephole
-fomit-frame-pointer -foptimize-register-move
-foptimize-sibling-calls -freduce-all-givs
-fregmove -frename-registers
--- 249,256 ----
-finline-functions -finline-limit=@var{n} -fkeep-inline-functions
-fkeep-static-consts -fmove-all-movables
-fno-default-inline -fno-defer-pop
! -fno-function-cse -fno-guess-branch-probability -fno-inline
! -fno-math-errno -fno-peephole
-fomit-frame-pointer -foptimize-register-move
-foptimize-sibling-calls -freduce-all-givs
-fregmove -frename-registers
***************
*** 3090,3095 ****
--- 3091,3105 ----
branch is mostly to take, the @samp{REG_BR_PROB} values are used to
exactly determine which path is taken more often.
@end ifset
+
+ @item -fno-guess-branch-probability
+ Sometimes gcc will opt to guess branch probabilities when none are
+ available from either profile directed feedback (@samp{-fprofile-arcs})
+ or @samp(__builtin_expect). In a hard real-time system, people don't
+ want different runs of the compiler to produce code that has different
+ behavior; minimizing non-determinism is of paramount import. This
+ switch allows users to reduce non-determinism, possibly at the expense
+ of inferior optimization.
@item -fstrict-aliasing
Allows the compiler to assume the strictest aliasing rules applicable to