annotate gcc/testsuite/g++.dg/tree-ssa/ssa-dse-2.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* { dg-do compile } */
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
2 /* { dg-options "-O2 -fdump-tree-dse2-details -Wno-return-type" } */
111
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 typedef __SIZE_TYPE__ size_t;
kono
parents:
diff changeset
5 extern "C"
kono
parents:
diff changeset
6 {
kono
parents:
diff changeset
7 extern void *memmove (void *__dest, const void *__src, size_t __n) throw ()
kono
parents:
diff changeset
8 __attribute__ ((__nonnull__ (1, 2)));
kono
parents:
diff changeset
9 }
kono
parents:
diff changeset
10 extern void abort () __attribute__ ((__noreturn__));
kono
parents:
diff changeset
11 struct vec_prefix { unsigned m_num; };
kono
parents:
diff changeset
12 struct vl_embed { };
kono
parents:
diff changeset
13 struct vl_ptr { };
kono
parents:
diff changeset
14 struct va_heap { typedef vl_ptr default_layout; };
kono
parents:
diff changeset
15 template < typename T, typename A = va_heap, typename L = typename A::default_layout > struct vec { };
kono
parents:
diff changeset
16 template < typename T, typename A > struct vec < T, A, vl_embed >
kono
parents:
diff changeset
17 {
kono
parents:
diff changeset
18 unsigned length (void) const { return m_vecpfx. m_num; }
kono
parents:
diff changeset
19 bool is_empty (void) const { return m_vecpfx. m_num == 0; }
kono
parents:
diff changeset
20 void block_remove (unsigned, unsigned);
kono
parents:
diff changeset
21 vec_prefix m_vecpfx;
kono
parents:
diff changeset
22 T m_vecdata[1];
kono
parents:
diff changeset
23 };
kono
parents:
diff changeset
24 template < typename T, typename A > inline void vec < T, A, vl_embed >::block_remove (unsigned ix, unsigned len)
kono
parents:
diff changeset
25 {
kono
parents:
diff changeset
26 T * slot = &m_vecdata[ix];
kono
parents:
diff changeset
27 m_vecpfx.m_num -= len;
kono
parents:
diff changeset
28 memmove (slot, slot + len, (m_vecpfx.m_num - ix) * sizeof (T));
kono
parents:
diff changeset
29 }
kono
parents:
diff changeset
30
kono
parents:
diff changeset
31 template < typename T > struct vec < T, va_heap, vl_ptr >
kono
parents:
diff changeset
32 {
kono
parents:
diff changeset
33 bool is_empty (void) const { return m_vec ? m_vec-> is_empty () : true; }
kono
parents:
diff changeset
34 unsigned length (void) const { return m_vec ? m_vec-> length () : 0; }
kono
parents:
diff changeset
35 void block_remove (unsigned, unsigned);
kono
parents:
diff changeset
36 vec < T, va_heap, vl_embed > * m_vec;
kono
parents:
diff changeset
37 };
kono
parents:
diff changeset
38 template < typename T > inline void vec < T, va_heap, vl_ptr >::block_remove (unsigned ix, unsigned len)
kono
parents:
diff changeset
39 {
kono
parents:
diff changeset
40 m_vec->block_remove (ix, len);
kono
parents:
diff changeset
41 }
kono
parents:
diff changeset
42
kono
parents:
diff changeset
43 typedef struct _list_node * _list_t;
kono
parents:
diff changeset
44 typedef struct _expr expr_def;
kono
parents:
diff changeset
45 typedef expr_def * expr_t;
kono
parents:
diff changeset
46 typedef _list_t av_set_t;
kono
parents:
diff changeset
47 static vec < expr_t > vec_av_set;
kono
parents:
diff changeset
48 bool
kono
parents:
diff changeset
49 fill_vec_av_set (av_set_t av)
kono
parents:
diff changeset
50 {
kono
parents:
diff changeset
51 if (vec_av_set.length () > 0)
kono
parents:
diff changeset
52 vec_av_set.block_remove (0, vec_av_set.length ());
kono
parents:
diff changeset
53 ((!(vec_av_set.is_empty ())? abort () , 0 : 0));
kono
parents:
diff changeset
54 }
kono
parents:
diff changeset
55
kono
parents:
diff changeset
56 /* { dg-final { scan-tree-dump-not "Trimming statement .head = -" "dse2" } } */
kono
parents:
diff changeset
57 /* { dg-final { scan-tree-dump-not "mem\[^\r\n\]*, 0\\);" "dse2" } } */