https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50160

--- Comment #46 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Using this google/benchmark test:

#include <vector>
#include "benchmark/benchmark.h"

void BM_cmp(benchmark::State& state) {
  std::vector<bool> v1(250);
  std::vector<bool> v2(250);
  v2.back() = true;
  for (auto _ : state) {
    benchmark::DoNotOptimize(v1 < v2);
  }
}
BENCHMARK(BM_cmp);

BENCHMARK_MAIN();


The comparison is four times faster when compiled with -DFIX to enable the new
code.

Reply via email to