diff gcc/testsuite/g++.dg/opt/pr82929.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gcc/testsuite/g++.dg/opt/pr82929.C	Thu Oct 25 07:37:49 2018 +0900
@@ -0,0 +1,30 @@
+// PR tree-optimization/82929
+// { dg-do compile }
+// { dg-options "-O2" }
+
+template <int _Nw> struct A {
+  long _M_w[_Nw];
+  void m_fn1(A p1) {
+    for (int a = 0;; a++)
+      _M_w[a] &= p1._M_w[a];
+  }
+  void m_fn2() {
+    for (int b = 0; b < _Nw; b++)
+      _M_w[b] = ~_M_w[b];
+  }
+};
+template <int _Nb> struct C : A<_Nb / (8 * 8)> {
+  void operator&=(C p1) { this->m_fn1(p1); }
+  C m_fn3() {
+    this->m_fn2();
+    return *this;
+  }
+  C operator~() { return C(*this).m_fn3(); }
+};
+struct B {
+  C<192> Value;
+};
+void fn1(C<192> &p1) {
+  B c;
+  p1 &= ~c.Value;
+}