PR tree-optimization/82929
[official-gcc.git] / gcc / testsuite / g++.dg / opt / pr82929.C
blob572f4914815866e1bed93b0de1cbba1a5662e860
1 // PR tree-optimization/82929
2 // { dg-do compile }
3 // { dg-options "-O2" }
5 template <int _Nw> struct A {
6   long _M_w[_Nw];
7   void m_fn1(A p1) {
8     for (int a = 0;; a++)
9       _M_w[a] &= p1._M_w[a];
10   }
11   void m_fn2() {
12     for (int b = 0; b < _Nw; b++)
13       _M_w[b] = ~_M_w[b];
14   }
16 template <int _Nb> struct C : A<_Nb / (8 * 8)> {
17   void operator&=(C p1) { this->m_fn1(p1); }
18   C m_fn3() {
19     this->m_fn2();
20     return *this;
21   }
22   C operator~() { return C(*this).m_fn3(); }
24 struct B {
25   C<192> Value;
27 void fn1(C<192> &p1) {
28   B c;
29   p1 &= ~c.Value;