This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/83610] __builtin_expect sometimes is ignored


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?

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]