This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/83610] __builtin_expect sometimes is ignored
- From: "marxin at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 29 Dec 2017 11:31:37 +0000
- Subject: [Bug middle-end/83610] __builtin_expect sometimes is ignored
- Auto-submitted: auto-generated
- References: <bug-83610-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83610
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |WAITING
Last reconfirmed| |2017-12-29
CC| |marxin at gcc dot gnu.org
Ever confirmed|0 |1
--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
Thanks for report. I can confirm that it changed in GCC 4.9.0 and newer
versions.
Note that version without branching (using cmove) is actually also conditional
code and is transformed by 'If-conversion pass'.
What you can do is to change default probability of expect (which is by default
90%):
--param builtin-expect-probability=99
Doing that I see original version w/o cmove. Is it helpful for you?
Do you have a microbenchmark you can attach that compares speed of both
versions?