https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117935
--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> --- (In reply to Jan Hubicka from comment #5) > Note that propagation of branch probabilities from callee to caller > works only by kind of accident. I originally made branch prediction to > be done after early inlining since it makes some patterns branch > predictors looks for to appear. > > with the likely attribute it will only happen with early inlining and not > with late inlining, since there is a chicken-egg problem. To make good > inline decisions you already need profile to be computed. > So I am not sure we want to convince users these hints are going to be > used. Perhaps with always_inline functions. Why would this argument not apply equally to __builtin_expect? In both cases the program is expressing that b is probably true.