| 1 |
// PR tree-optimization/82929 |
| 2 |
// { dg-do compile } |
| 3 |
// { dg-options "-O2" } |
| 4 |
|
| 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 |
} |
| 15 |
}; |
| 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(); } |
| 23 |
}; |
| 24 |
struct B { |
| 25 |
C<192> Value; |
| 26 |
}; |
| 27 |
void fn1(C<192> &p1) { |
| 28 |
B c; |
| 29 |
p1 &= ~c.Value; |
| 30 |
} |