This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: disabling branch probability guessing (patch)
- To: ak at suse dot de (Andi Kleen)
- Subject: Re: disabling branch probability guessing (patch)
- From: Joe Buck <jbuck at racerx dot synopsys dot com>
- Date: Tue, 16 Jan 2001 08:55:36 -0800 (PST)
- Cc: aldyh at redhat dot com (Aldy Hernandez), gcc at gcc dot gnu dot org
> > Here is a patch that adds an option to disable guessing of branch
> > probabilities (-fno-guess-branch-probability).
Ouch. The user has to enter a flag to get the right thing.
Andi Kleen writes:
> Cool. This is useful for the linux kernel too. I found out that the
> prediction guessing undoes some of the carefully crafted goto woods
> to keep fast paths jumpless.
I'm not sure that this is really the right solution. In all examples
in which I've seen gotos used by good programmers, the goto is an
exceptional condition and should be predicted not-taken. Can't we
just flag branches originally entered as gotos?