annotate gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-31.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-pre -fno-ipa-sra" } */
111
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 typedef struct {
kono
parents:
diff changeset
5 unsigned int key;
kono
parents:
diff changeset
6 } S;
kono
parents:
diff changeset
7 typedef struct s1 {
kono
parents:
diff changeset
8 unsigned int key;
kono
parents:
diff changeset
9 unsigned int bits;
kono
parents:
diff changeset
10 struct s1 *left, *right;
kono
parents:
diff changeset
11 }S1;
kono
parents:
diff changeset
12 extern S a[1024];
kono
parents:
diff changeset
13 static inline int bar( S* p, S1* n )
kono
parents:
diff changeset
14 {
kono
parents:
diff changeset
15 S1 *curr;
kono
parents:
diff changeset
16 S1 *next;
kono
parents:
diff changeset
17
kono
parents:
diff changeset
18 if ( n->left == n )
kono
parents:
diff changeset
19 return (int)(p->key == n->key);
kono
parents:
diff changeset
20
kono
parents:
diff changeset
21 curr = n;
kono
parents:
diff changeset
22 next = n->left;
kono
parents:
diff changeset
23
kono
parents:
diff changeset
24 while (curr->bits > next->bits ) {
kono
parents:
diff changeset
25 curr = next;
kono
parents:
diff changeset
26 if (p->key & (1 << curr->bits))
kono
parents:
diff changeset
27 next = curr->right;
kono
parents:
diff changeset
28 else
kono
parents:
diff changeset
29 next = curr->left;
kono
parents:
diff changeset
30 }
kono
parents:
diff changeset
31
kono
parents:
diff changeset
32 return (int)(p->key == next->key);
kono
parents:
diff changeset
33
kono
parents:
diff changeset
34 }
kono
parents:
diff changeset
35
kono
parents:
diff changeset
36 int foo (S1 *root, int N)
kono
parents:
diff changeset
37 {
kono
parents:
diff changeset
38 volatile int r;
kono
parents:
diff changeset
39 int i,j;
kono
parents:
diff changeset
40 for (i=0; i<N; i++)
kono
parents:
diff changeset
41 for (j=0;j<1024; j++)
kono
parents:
diff changeset
42 r = bar(&a[j], root);
kono
parents:
diff changeset
43 return 0;
kono
parents:
diff changeset
44 }
kono
parents:
diff changeset
45
kono
parents:
diff changeset
46 /* { dg-final { scan-tree-dump-times "key" 3 "pre" } } */