| 1 |
void abort(void); |
| 2 |
|
| 3 |
struct table_elt |
| 4 |
{ |
| 5 |
void *exp; |
| 6 |
struct table_elt *next_same_hash; |
| 7 |
struct table_elt *prev_same_hash; |
| 8 |
struct table_elt *next_same_value; |
| 9 |
struct table_elt *prev_same_value; |
| 10 |
struct table_elt *first_same_value; |
| 11 |
struct table_elt *related_value; |
| 12 |
int cost; |
| 13 |
int mode; |
| 14 |
char in_memory; |
| 15 |
char in_struct; |
| 16 |
char is_const; |
| 17 |
char flag; |
| 18 |
}; |
| 19 |
|
| 20 |
struct write_data |
| 21 |
{ |
| 22 |
int sp : 1; |
| 23 |
int var : 1; |
| 24 |
int nonscalar : 1; |
| 25 |
int all : 1; |
| 26 |
}; |
| 27 |
|
| 28 |
int cse_rtx_addr_varies_p(void *); |
| 29 |
void remove_from_table(struct table_elt *, int); |
| 30 |
static struct table_elt *table[32]; |
| 31 |
|
| 32 |
void |
| 33 |
invalidate_memory (writes) |
| 34 |
struct write_data *writes; |
| 35 |
{ |
| 36 |
register int i; |
| 37 |
register struct table_elt *p, *next; |
| 38 |
int all = writes->all; |
| 39 |
int nonscalar = writes->nonscalar; |
| 40 |
|
| 41 |
for (i = 0; i < 31; i++) |
| 42 |
for (p = table[i]; p; p = next) |
| 43 |
{ |
| 44 |
next = p->next_same_hash; |
| 45 |
if (p->in_memory |
| 46 |
&& (all |
| 47 |
|| (nonscalar && p->in_struct) |
| 48 |
|| cse_rtx_addr_varies_p (p->exp))) |
| 49 |
remove_from_table (p, i); |
| 50 |
} |
| 51 |
} |
| 52 |
|
| 53 |
int cse_rtx_addr_varies_p(void *x) { return 0; } |
| 54 |
void remove_from_table(struct table_elt *x, int y) { abort (); } |
| 55 |
|
| 56 |
int |
| 57 |
main() |
| 58 |
{ |
| 59 |
struct write_data writes; |
| 60 |
struct table_elt elt; |
| 61 |
|
| 62 |
__builtin_memset(&elt, 0, sizeof(elt)); |
| 63 |
elt.in_memory = 1; |
| 64 |
table[0] = &elt; |
| 65 |
|
| 66 |
__builtin_memset(&writes, 0, sizeof(writes)); |
| 67 |
writes.var = 1; |
| 68 |
writes.nonscalar = 1; |
| 69 |
|
| 70 |
invalidate_memory(&writes); |
| 71 |
return 0; |
| 72 |
} |