PR middle-end/30262
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / 20000815-1.c
blob22b537f993aff55285f896b6e85b163c7501ded7
1 struct table_elt
3 void *exp;
4 struct table_elt *next_same_hash;
5 struct table_elt *prev_same_hash;
6 struct table_elt *next_same_value;
7 struct table_elt *prev_same_value;
8 struct table_elt *first_same_value;
9 struct table_elt *related_value;
10 int cost;
11 int mode;
12 char in_memory;
13 char in_struct;
14 char is_const;
15 char flag;
18 struct write_data
20 int sp : 1;
21 int var : 1;
22 int nonscalar : 1;
23 int all : 1;
26 int cse_rtx_addr_varies_p(void *);
27 void remove_from_table(struct table_elt *, int);
28 static struct table_elt *table[32];
30 void
31 invalidate_memory (writes)
32 struct write_data *writes;
34 register int i;
35 register struct table_elt *p, *next;
36 int all = writes->all;
37 int nonscalar = writes->nonscalar;
39 for (i = 0; i < 31; i++)
40 for (p = table[i]; p; p = next)
42 next = p->next_same_hash;
43 if (p->in_memory
44 && (all
45 || (nonscalar && p->in_struct)
46 || cse_rtx_addr_varies_p (p->exp)))
47 remove_from_table (p, i);
51 int cse_rtx_addr_varies_p(void *x) { return 0; }
52 void remove_from_table(struct table_elt *x, int y) { abort (); }
54 int
55 main()
57 struct write_data writes;
58 struct table_elt elt;
60 __builtin_memset(&elt, 0, sizeof(elt));
61 elt.in_memory = 1;
62 table[0] = &elt;
64 __builtin_memset(&writes, 0, sizeof(writes));
65 writes.var = 1;
66 writes.nonscalar = 1;
68 invalidate_memory(&writes);
69 return 0;