https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105338
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|NEW |RESOLVED --- Comment #12 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Fixed. I think you can use if (__builtin_expect_with_probability (!b, 0, 0.5)) return -2; else return 0; if you want to override the return negative heuristics. Or if you use it in places where that heuristics doesn't trigger, say: int bar (int); int g(int i) { return bar (i ? -2 : 0); }