re PR middle-end/70887 (internal compiler error in trunc_int_for_mode, at explow...
authorJakub Jelinek <jakub@redhat.com>
Tue, 10 Oct 2017 20:11:21 +0000 (22:11 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 10 Oct 2017 20:11:21 +0000 (22:11 +0200)
2017-10-10  Jakub Jelinek  <jakub@redhat.com>

PR middle-end/70887
* g++.dg/cpp0x/pr70887.C: New test.

From-SVN: r253616

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/pr70887.C [new file with mode: 0644]

index 43fb756f6ffcacb3797ce711e4c42c04e21ff950..3dcc261d131c93b8a35ef524c5bf3305e0371b67 100644 (file)
@@ -1,5 +1,8 @@
 2017-10-10  Jakub Jelinek  <jakub@redhat.com>
 
+       PR middle-end/70887
+       * g++.dg/cpp0x/pr70887.C: New test.
+
        PR c++/70338
        * g++.dg/cpp0x/pr70338.C: New test.
 
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr70887.C b/gcc/testsuite/g++.dg/cpp0x/pr70887.C
new file mode 100644 (file)
index 0000000..f5b31b2
--- /dev/null
@@ -0,0 +1,31 @@
+// PR middle-end/70887
+// { dg-do compile { target { { i?86-*-* x86_64-*-* } && c++11 } } }
+// { dg-options "-O2 -msse2" }
+
+#include <x86intrin.h>
+
+enum R { S };
+template <R> struct C { static constexpr int value = 10; };
+template <typename R, template <R> class T, R... r>
+struct A {
+  template <int, R...> struct B;
+  template <int N, R M, R... O>
+  struct B<N, M, O...> {
+    static constexpr int d = T<M>::value;
+    static __m128i generate()
+    {
+      __attribute__((__vector_size__(16))) long long
+      a = generate(),
+      b = _mm_bslli_si128 (a, 1),
+      c = _mm_bsrli_si128 (_mm_set1_epi32(d), 12);
+      return _mm_or_si128 (b, c);
+    }
+  };
+  A () { B<0, r...>::generate(); }
+};
+
+int
+main () {
+  using RI = A<R, C, S>;
+  RI ri;
+}