re PR tree-optimization/92751 (VN partial def support confused about clobbers)
[official-gcc.git] / gcc / testsuite / g++.dg / tree-ssa / pr92751.C
blobd107482f34d61c07cf2341fc53e61ac0c756aeec
1 // { dg-do compile }
2 // { dg-options "-O -fdump-tree-fre1" }
4 inline void* operator new(__SIZE_TYPE__, void* p) { return p; }
5 template<int N>
6 struct Vec {
7   Vec(int v) : lo(v), hi(v) {};
8   Vec<N/2> lo, hi;
9 };
10 template<>
11 struct Vec<1> {
12   Vec(int v) : val(v) {}
13   int val;
16 typedef int v4si __attribute__((vector_size(16)));
17 void foo (v4si *dst)
19   Vec<4> v(1);
20   v4si tem;
21   __builtin_memcpy (&tem, &v, sizeof (tem));
22   *dst = tem;
25 // FRE should be able to value-number 'tem' to a constant.  */
26 // { dg-final { scan-tree-dump "\\*dst_\[0-9\]*\\\(D\\\) = { 1, 1, 1, 1 };" "fre1" } }