view gcc/testsuite/g++.dg/opt/pr77844.C @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 04ced10e8804
children
line wrap: on
line source

// PR debug/77844
// { dg-do compile }
// { dg-options "-O3 -g" }

#include <vector>

void
foo (std::vector<bool>& v, int i, int j)
{
  for (int k = 0; k < 5; ++k)
    v[5 * i + k] = v[5 * i + k] | v[5 * j + k];
}

void
bar (std::vector<bool>& v, int i, int j)
{
  for (int k = 0; k < 5; ++k)
    v[5 * i + k] = v[5 * i + k] ^ v[5 * j + k];
}

void
baz (std::vector<bool>& v)
{
  foo (v, 4, 1);
  foo (v, 4, 2);
  foo (v, 4, 3);
  foo (v, 4, 4);
  bar (v, 4, 1);
  bar (v, 4, 2);
  bar (v, 4, 3);
  bar (v, 4, 4);
}