1 struct table_elt 2 { 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; 16 }; 17 18 struct write_data 19 { 20 int sp : 1; 21 int var : 1; 22 int nonscalar : 1; 23 int all : 1; 24 }; 25 26 int cse_rtx_addr_varies_p(void *); 27 void remove_from_table(struct table_elt *, int); 28 static struct table_elt *table[32]; 29 30 void invalidate_memory(writes)31invalidate_memory (writes) 32 struct write_data *writes; 33 { 34 register int i; 35 register struct table_elt *p, *next; 36 int all = writes->all; 37 int nonscalar = writes->nonscalar; 38 39 for (i = 0; i < 31; i++) 40 for (p = table[i]; p; p = next) 41 { 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); 48 } 49 } 50 cse_rtx_addr_varies_p(void * x)51int cse_rtx_addr_varies_p(void *x) { return 0; } remove_from_table(struct table_elt * x,int y)52void remove_from_table(struct table_elt *x, int y) { abort (); } 53 54 int main()55main() 56 { 57 struct write_data writes; 58 struct table_elt elt; 59 60 __builtin_memset(&elt, 0, sizeof(elt)); 61 elt.in_memory = 1; 62 table[0] = &elt; 63 64 __builtin_memset(&writes, 0, sizeof(writes)); 65 writes.var = 1; 66 writes.nonscalar = 1; 67 68 invalidate_memory(&writes); 69 return 0; 70 } 71