https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66573
--- Comment #10 from Segher Boessenkool <segher at gcc dot gnu.org> --- GCC thinks bar2 will be executed more often that bar1; the code it generates is perfectly fine for that. If you think GCC's heuristics for branch prediction are no good, could use some improvement, you'll have to come up with more evidence than just a single artificial testcase. Sorry. These things were tuned on real code.