http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51078
--- Comment #13 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-11-11 23:03:38 UTC --- I would say, the next step, is analyzing why: std::count seems a very simple algorithm, no aliasing issues for example, compiler should be able to unroll, maybe vectorize too, and everything else, without having to fiddle with the code in an ad-hoc way.