https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85740
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|middle-end |target --- Comment #11 from Andrew Pinski <pinskia at gcc dot gnu.org> --- So GCC heurstics for figuring out a[i] > m if it is likely or unlikely is always going to be "wrong". My bet if the test vector was always incrementing, the version without the __builtin_expect would be faster. x86_64 has a loop cache which is why the version without the __builtin_expect seems faster.