OSDN Git Service

* cfganal.c (flow_depth_first_order_compute, dfs_enumerate_from,
[pf3gnuchains/gcc-fork.git] / gcc / cselib.c
1 /* Common subexpression elimination library for GNU compiler.
2    Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
3    1999, 2000, 2001, 2003, 2004 Free Software Foundation, Inc.
4
5 This file is part of GCC.
6
7 GCC is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2, or (at your option) any later
10 version.
11
12 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15 for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING.  If not, write to the Free
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
20 02111-1307, USA.  */
21
22 #include "config.h"
23 #include "system.h"
24 #include "coretypes.h"
25 #include "tm.h"
26
27 #include "rtl.h"
28 #include "tm_p.h"
29 #include "regs.h"
30 #include "hard-reg-set.h"
31 #include "flags.h"
32 #include "real.h"
33 #include "insn-config.h"
34 #include "recog.h"
35 #include "function.h"
36 #include "emit-rtl.h"
37 #include "toplev.h"
38 #include "output.h"
39 #include "ggc.h"
40 #include "hashtab.h"
41 #include "cselib.h"
42 #include "params.h"
43 #include "alloc-pool.h"
44
45 static bool cselib_record_memory;
46 static int entry_and_rtx_equal_p (const void *, const void *);
47 static hashval_t get_value_hash (const void *);
48 static struct elt_list *new_elt_list (struct elt_list *, cselib_val *);
49 static struct elt_loc_list *new_elt_loc_list (struct elt_loc_list *, rtx);
50 static void unchain_one_value (cselib_val *);
51 static void unchain_one_elt_list (struct elt_list **);
52 static void unchain_one_elt_loc_list (struct elt_loc_list **);
53 static void clear_table (void);
54 static int discard_useless_locs (void **, void *);
55 static int discard_useless_values (void **, void *);
56 static void remove_useless_values (void);
57 static rtx wrap_constant (enum machine_mode, rtx);
58 static unsigned int cselib_hash_rtx (rtx, enum machine_mode, int);
59 static cselib_val *new_cselib_val (unsigned int, enum machine_mode);
60 static void add_mem_for_addr (cselib_val *, cselib_val *, rtx);
61 static cselib_val *cselib_lookup_mem (rtx, int);
62 static void cselib_invalidate_regno (unsigned int, enum machine_mode);
63 static void cselib_invalidate_mem (rtx);
64 static void cselib_invalidate_rtx (rtx, rtx, void *);
65 static void cselib_record_set (rtx, cselib_val *, cselib_val *);
66 static void cselib_record_sets (rtx);
67
68 /* There are three ways in which cselib can look up an rtx:
69    - for a REG, the reg_values table (which is indexed by regno) is used
70    - for a MEM, we recursively look up its address and then follow the
71      addr_list of that value
72    - for everything else, we compute a hash value and go through the hash
73      table.  Since different rtx's can still have the same hash value,
74      this involves walking the table entries for a given value and comparing
75      the locations of the entries with the rtx we are looking up.  */
76
77 /* A table that enables us to look up elts by their value.  */
78 static htab_t hash_table;
79
80 /* This is a global so we don't have to pass this through every function.
81    It is used in new_elt_loc_list to set SETTING_INSN.  */
82 static rtx cselib_current_insn;
83 static bool cselib_current_insn_in_libcall;
84
85 /* Every new unknown value gets a unique number.  */
86 static unsigned int next_unknown_value;
87
88 /* The number of registers we had when the varrays were last resized.  */
89 static unsigned int cselib_nregs;
90
91 /* Count values without known locations.  Whenever this grows too big, we
92    remove these useless values from the table.  */
93 static int n_useless_values;
94
95 /* Number of useless values before we remove them from the hash table.  */
96 #define MAX_USELESS_VALUES 32
97
98 /* This table maps from register number to values.  It does not
99    contain pointers to cselib_val structures, but rather elt_lists.
100    The purpose is to be able to refer to the same register in
101    different modes.  The first element of the list defines the mode in
102    which the register was set; if the mode is unknown or the value is
103    no longer valid in that mode, ELT will be NULL for the first
104    element.  */
105 struct elt_list **reg_values;
106 unsigned int reg_values_size;
107 #define REG_VALUES(i) reg_values[i]
108
109 /* The largest number of hard regs used by any entry added to the
110    REG_VALUES table.  Cleared on each clear_table() invocation.  */
111 static unsigned int max_value_regs;
112
113 /* Here the set of indices I with REG_VALUES(I) != 0 is saved.  This is used
114    in clear_table() for fast emptying.  */
115 static unsigned int *used_regs;
116 static unsigned int n_used_regs;
117
118 /* We pass this to cselib_invalidate_mem to invalidate all of
119    memory for a non-const call instruction.  */
120 static GTY(()) rtx callmem;
121
122 /* Set by discard_useless_locs if it deleted the last location of any
123    value.  */
124 static int values_became_useless;
125
126 /* Used as stop element of the containing_mem list so we can check
127    presence in the list by checking the next pointer.  */
128 static cselib_val dummy_val;
129
130 /* Used to list all values that contain memory reference.
131    May or may not contain the useless values - the list is compacted
132    each time memory is invalidated.  */
133 static cselib_val *first_containing_mem = &dummy_val;
134 static alloc_pool elt_loc_list_pool, elt_list_pool, cselib_val_pool, value_pool;
135 \f
136
137 /* Allocate a struct elt_list and fill in its two elements with the
138    arguments.  */
139
140 static inline struct elt_list *
141 new_elt_list (struct elt_list *next, cselib_val *elt)
142 {
143   struct elt_list *el;
144   el = pool_alloc (elt_list_pool);
145   el->next = next;
146   el->elt = elt;
147   return el;
148 }
149
150 /* Allocate a struct elt_loc_list and fill in its two elements with the
151    arguments.  */
152
153 static inline struct elt_loc_list *
154 new_elt_loc_list (struct elt_loc_list *next, rtx loc)
155 {
156   struct elt_loc_list *el;
157   el = pool_alloc (elt_loc_list_pool);
158   el->next = next;
159   el->loc = loc;
160   el->setting_insn = cselib_current_insn;
161   el->in_libcall = cselib_current_insn_in_libcall;
162   return el;
163 }
164
165 /* The elt_list at *PL is no longer needed.  Unchain it and free its
166    storage.  */
167
168 static inline void
169 unchain_one_elt_list (struct elt_list **pl)
170 {
171   struct elt_list *l = *pl;
172
173   *pl = l->next;
174   pool_free (elt_list_pool, l);
175 }
176
177 /* Likewise for elt_loc_lists.  */
178
179 static void
180 unchain_one_elt_loc_list (struct elt_loc_list **pl)
181 {
182   struct elt_loc_list *l = *pl;
183
184   *pl = l->next;
185   pool_free (elt_loc_list_pool, l);
186 }
187
188 /* Likewise for cselib_vals.  This also frees the addr_list associated with
189    V.  */
190
191 static void
192 unchain_one_value (cselib_val *v)
193 {
194   while (v->addr_list)
195     unchain_one_elt_list (&v->addr_list);
196
197   pool_free (cselib_val_pool, v);
198 }
199
200 /* Remove all entries from the hash table.  Also used during
201    initialization.  If CLEAR_ALL isn't set, then only clear the entries
202    which are known to have been used.  */
203
204 static void
205 clear_table (void)
206 {
207   unsigned int i;
208
209   for (i = 0; i < n_used_regs; i++)
210     REG_VALUES (used_regs[i]) = 0;
211
212   max_value_regs = 0;
213
214   n_used_regs = 0;
215
216   htab_empty (hash_table);
217
218   n_useless_values = 0;
219
220   next_unknown_value = 0;
221
222   first_containing_mem = &dummy_val;
223 }
224
225 /* The equality test for our hash table.  The first argument ENTRY is a table
226    element (i.e. a cselib_val), while the second arg X is an rtx.  We know
227    that all callers of htab_find_slot_with_hash will wrap CONST_INTs into a
228    CONST of an appropriate mode.  */
229
230 static int
231 entry_and_rtx_equal_p (const void *entry, const void *x_arg)
232 {
233   struct elt_loc_list *l;
234   const cselib_val *v = (const cselib_val *) entry;
235   rtx x = (rtx) x_arg;
236   enum machine_mode mode = GET_MODE (x);
237
238   gcc_assert (GET_CODE (x) != CONST_INT
239               && (mode != VOIDmode || GET_CODE (x) != CONST_DOUBLE));
240   
241   if (mode != GET_MODE (v->u.val_rtx))
242     return 0;
243
244   /* Unwrap X if necessary.  */
245   if (GET_CODE (x) == CONST
246       && (GET_CODE (XEXP (x, 0)) == CONST_INT
247           || GET_CODE (XEXP (x, 0)) == CONST_DOUBLE))
248     x = XEXP (x, 0);
249
250   /* We don't guarantee that distinct rtx's have different hash values,
251      so we need to do a comparison.  */
252   for (l = v->locs; l; l = l->next)
253     if (rtx_equal_for_cselib_p (l->loc, x))
254       return 1;
255
256   return 0;
257 }
258
259 /* The hash function for our hash table.  The value is always computed with
260    cselib_hash_rtx when adding an element; this function just extracts the
261    hash value from a cselib_val structure.  */
262
263 static hashval_t
264 get_value_hash (const void *entry)
265 {
266   const cselib_val *v = (const cselib_val *) entry;
267   return v->value;
268 }
269
270 /* Return true if X contains a VALUE rtx.  If ONLY_USELESS is set, we
271    only return true for values which point to a cselib_val whose value
272    element has been set to zero, which implies the cselib_val will be
273    removed.  */
274
275 int
276 references_value_p (rtx x, int only_useless)
277 {
278   enum rtx_code code = GET_CODE (x);
279   const char *fmt = GET_RTX_FORMAT (code);
280   int i, j;
281
282   if (GET_CODE (x) == VALUE
283       && (! only_useless || CSELIB_VAL_PTR (x)->locs == 0))
284     return 1;
285
286   for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
287     {
288       if (fmt[i] == 'e' && references_value_p (XEXP (x, i), only_useless))
289         return 1;
290       else if (fmt[i] == 'E')
291         for (j = 0; j < XVECLEN (x, i); j++)
292           if (references_value_p (XVECEXP (x, i, j), only_useless))
293             return 1;
294     }
295
296   return 0;
297 }
298
299 /* For all locations found in X, delete locations that reference useless
300    values (i.e. values without any location).  Called through
301    htab_traverse.  */
302
303 static int
304 discard_useless_locs (void **x, void *info ATTRIBUTE_UNUSED)
305 {
306   cselib_val *v = (cselib_val *)*x;
307   struct elt_loc_list **p = &v->locs;
308   int had_locs = v->locs != 0;
309
310   while (*p)
311     {
312       if (references_value_p ((*p)->loc, 1))
313         unchain_one_elt_loc_list (p);
314       else
315         p = &(*p)->next;
316     }
317
318   if (had_locs && v->locs == 0)
319     {
320       n_useless_values++;
321       values_became_useless = 1;
322     }
323   return 1;
324 }
325
326 /* If X is a value with no locations, remove it from the hashtable.  */
327
328 static int
329 discard_useless_values (void **x, void *info ATTRIBUTE_UNUSED)
330 {
331   cselib_val *v = (cselib_val *)*x;
332
333   if (v->locs == 0)
334     {
335       CSELIB_VAL_PTR (v->u.val_rtx) = NULL;
336       htab_clear_slot (hash_table, x);
337       unchain_one_value (v);
338       n_useless_values--;
339     }
340
341   return 1;
342 }
343
344 /* Clean out useless values (i.e. those which no longer have locations
345    associated with them) from the hash table.  */
346
347 static void
348 remove_useless_values (void)
349 {
350   cselib_val **p, *v;
351   /* First pass: eliminate locations that reference the value.  That in
352      turn can make more values useless.  */
353   do
354     {
355       values_became_useless = 0;
356       htab_traverse (hash_table, discard_useless_locs, 0);
357     }
358   while (values_became_useless);
359
360   /* Second pass: actually remove the values.  */
361
362   p = &first_containing_mem;
363   for (v = *p; v != &dummy_val; v = v->next_containing_mem)
364     if (v->locs)
365       {
366         *p = v;
367         p = &(*p)->next_containing_mem;
368       }
369   *p = &dummy_val;
370
371   htab_traverse (hash_table, discard_useless_values, 0);
372
373   gcc_assert (!n_useless_values);
374 }
375
376 /* Return the mode in which a register was last set.  If X is not a
377    register, return its mode.  If the mode in which the register was
378    set is not known, or the value was already clobbered, return
379    VOIDmode.  */
380
381 enum machine_mode
382 cselib_reg_set_mode (rtx x)
383 {
384   if (!REG_P (x))
385     return GET_MODE (x);
386
387   if (REG_VALUES (REGNO (x)) == NULL
388       || REG_VALUES (REGNO (x))->elt == NULL)
389     return VOIDmode;
390
391   return GET_MODE (REG_VALUES (REGNO (x))->elt->u.val_rtx);
392 }
393
394 /* Return nonzero if we can prove that X and Y contain the same value, taking
395    our gathered information into account.  */
396
397 int
398 rtx_equal_for_cselib_p (rtx x, rtx y)
399 {
400   enum rtx_code code;
401   const char *fmt;
402   int i;
403
404   if (REG_P (x) || MEM_P (x))
405     {
406       cselib_val *e = cselib_lookup (x, GET_MODE (x), 0);
407
408       if (e)
409         x = e->u.val_rtx;
410     }
411
412   if (REG_P (y) || MEM_P (y))
413     {
414       cselib_val *e = cselib_lookup (y, GET_MODE (y), 0);
415
416       if (e)
417         y = e->u.val_rtx;
418     }
419
420   if (x == y)
421     return 1;
422
423   if (GET_CODE (x) == VALUE && GET_CODE (y) == VALUE)
424     return CSELIB_VAL_PTR (x) == CSELIB_VAL_PTR (y);
425
426   if (GET_CODE (x) == VALUE)
427     {
428       cselib_val *e = CSELIB_VAL_PTR (x);
429       struct elt_loc_list *l;
430
431       for (l = e->locs; l; l = l->next)
432         {
433           rtx t = l->loc;
434
435           /* Avoid infinite recursion.  */
436           if (REG_P (t) || MEM_P (t))
437             continue;
438           else if (rtx_equal_for_cselib_p (t, y))
439             return 1;
440         }
441
442       return 0;
443     }
444
445   if (GET_CODE (y) == VALUE)
446     {
447       cselib_val *e = CSELIB_VAL_PTR (y);
448       struct elt_loc_list *l;
449
450       for (l = e->locs; l; l = l->next)
451         {
452           rtx t = l->loc;
453
454           if (REG_P (t) || MEM_P (t))
455             continue;
456           else if (rtx_equal_for_cselib_p (x, t))
457             return 1;
458         }
459
460       return 0;
461     }
462
463   if (GET_CODE (x) != GET_CODE (y) || GET_MODE (x) != GET_MODE (y))
464     return 0;
465
466   /* This won't be handled correctly by the code below.  */
467   if (GET_CODE (x) == LABEL_REF)
468     return XEXP (x, 0) == XEXP (y, 0);
469
470   code = GET_CODE (x);
471   fmt = GET_RTX_FORMAT (code);
472
473   for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
474     {
475       int j;
476
477       switch (fmt[i])
478         {
479         case 'w':
480           if (XWINT (x, i) != XWINT (y, i))
481             return 0;
482           break;
483
484         case 'n':
485         case 'i':
486           if (XINT (x, i) != XINT (y, i))
487             return 0;
488           break;
489
490         case 'V':
491         case 'E':
492           /* Two vectors must have the same length.  */
493           if (XVECLEN (x, i) != XVECLEN (y, i))
494             return 0;
495
496           /* And the corresponding elements must match.  */
497           for (j = 0; j < XVECLEN (x, i); j++)
498             if (! rtx_equal_for_cselib_p (XVECEXP (x, i, j),
499                                           XVECEXP (y, i, j)))
500               return 0;
501           break;
502
503         case 'e':
504           if (! rtx_equal_for_cselib_p (XEXP (x, i), XEXP (y, i)))
505             return 0;
506           break;
507
508         case 'S':
509         case 's':
510           if (strcmp (XSTR (x, i), XSTR (y, i)))
511             return 0;
512           break;
513
514         case 'u':
515           /* These are just backpointers, so they don't matter.  */
516           break;
517
518         case '0':
519         case 't':
520           break;
521
522           /* It is believed that rtx's at this level will never
523              contain anything but integers and other rtx's,
524              except for within LABEL_REFs and SYMBOL_REFs.  */
525         default:
526           gcc_unreachable ();
527         }
528     }
529   return 1;
530 }
531
532 /* We need to pass down the mode of constants through the hash table
533    functions.  For that purpose, wrap them in a CONST of the appropriate
534    mode.  */
535 static rtx
536 wrap_constant (enum machine_mode mode, rtx x)
537 {
538   if (GET_CODE (x) != CONST_INT
539       && (GET_CODE (x) != CONST_DOUBLE || GET_MODE (x) != VOIDmode))
540     return x;
541   gcc_assert (mode != VOIDmode);
542   return gen_rtx_CONST (mode, x);
543 }
544
545 /* Hash an rtx.  Return 0 if we couldn't hash the rtx.
546    For registers and memory locations, we look up their cselib_val structure
547    and return its VALUE element.
548    Possible reasons for return 0 are: the object is volatile, or we couldn't
549    find a register or memory location in the table and CREATE is zero.  If
550    CREATE is nonzero, table elts are created for regs and mem.
551    MODE is used in hashing for CONST_INTs only;
552    otherwise the mode of X is used.  */
553
554 static unsigned int
555 cselib_hash_rtx (rtx x, enum machine_mode mode, int create)
556 {
557   cselib_val *e;
558   int i, j;
559   enum rtx_code code;
560   const char *fmt;
561   unsigned int hash = 0;
562
563   code = GET_CODE (x);
564   hash += (unsigned) code + (unsigned) GET_MODE (x);
565
566   switch (code)
567     {
568     case MEM:
569     case REG:
570       e = cselib_lookup (x, GET_MODE (x), create);
571       if (! e)
572         return 0;
573
574       return e->value;
575
576     case CONST_INT:
577       hash += ((unsigned) CONST_INT << 7) + (unsigned) mode + INTVAL (x);
578       return hash ? hash : (unsigned int) CONST_INT;
579
580     case CONST_DOUBLE:
581       /* This is like the general case, except that it only counts
582          the integers representing the constant.  */
583       hash += (unsigned) code + (unsigned) GET_MODE (x);
584       if (GET_MODE (x) != VOIDmode)
585         hash += real_hash (CONST_DOUBLE_REAL_VALUE (x));
586       else
587         hash += ((unsigned) CONST_DOUBLE_LOW (x)
588                  + (unsigned) CONST_DOUBLE_HIGH (x));
589       return hash ? hash : (unsigned int) CONST_DOUBLE;
590
591     case CONST_VECTOR:
592       {
593         int units;
594         rtx elt;
595
596         units = CONST_VECTOR_NUNITS (x);
597
598         for (i = 0; i < units; ++i)
599           {
600             elt = CONST_VECTOR_ELT (x, i);
601             hash += cselib_hash_rtx (elt, GET_MODE (elt), 0);
602           }
603
604         return hash;
605       }
606
607       /* Assume there is only one rtx object for any given label.  */
608     case LABEL_REF:
609       hash
610         += ((unsigned) LABEL_REF << 7) + (unsigned long) XEXP (x, 0);
611       return hash ? hash : (unsigned int) LABEL_REF;
612
613     case SYMBOL_REF:
614       hash
615         += ((unsigned) SYMBOL_REF << 7) + (unsigned long) XSTR (x, 0);
616       return hash ? hash : (unsigned int) SYMBOL_REF;
617
618     case PRE_DEC:
619     case PRE_INC:
620     case POST_DEC:
621     case POST_INC:
622     case POST_MODIFY:
623     case PRE_MODIFY:
624     case PC:
625     case CC0:
626     case CALL:
627     case UNSPEC_VOLATILE:
628       return 0;
629
630     case ASM_OPERANDS:
631       if (MEM_VOLATILE_P (x))
632         return 0;
633
634       break;
635
636     default:
637       break;
638     }
639
640   i = GET_RTX_LENGTH (code) - 1;
641   fmt = GET_RTX_FORMAT (code);
642   for (; i >= 0; i--)
643     {
644       switch (fmt[i])
645         {
646         case 'e':
647           {
648             rtx tem = XEXP (x, i);
649             unsigned int tem_hash = cselib_hash_rtx (tem, 0, create);
650             
651             if (tem_hash == 0)
652               return 0;
653             
654             hash += tem_hash;
655           }
656           break;
657         case 'E':
658           for (j = 0; j < XVECLEN (x, i); j++)
659             {
660               unsigned int tem_hash
661                 = cselib_hash_rtx (XVECEXP (x, i, j), 0, create);
662               
663               if (tem_hash == 0)
664                 return 0;
665               
666               hash += tem_hash;
667             }
668           break;
669
670         case 's':
671           {
672             const unsigned char *p = (const unsigned char *) XSTR (x, i);
673             
674             if (p)
675               while (*p)
676                 hash += *p++;
677             break;
678           }
679           
680         case 'i':
681           hash += XINT (x, i);
682           break;
683
684         case '0':
685         case 't':
686           /* unused */
687           break;
688           
689         default:
690           gcc_unreachable ();
691         }
692     }
693
694   return hash ? hash : 1 + (unsigned int) GET_CODE (x);
695 }
696
697 /* Create a new value structure for VALUE and initialize it.  The mode of the
698    value is MODE.  */
699
700 static inline cselib_val *
701 new_cselib_val (unsigned int value, enum machine_mode mode)
702 {
703   cselib_val *e = pool_alloc (cselib_val_pool);
704
705   gcc_assert (value);
706
707   e->value = value;
708   /* We use custom method to allocate this RTL construct because it accounts
709      about 8% of overall memory usage.  */
710   e->u.val_rtx = pool_alloc (value_pool);
711   memset (e->u.val_rtx, 0, RTX_HDR_SIZE);
712   PUT_CODE (e->u.val_rtx, VALUE);
713   PUT_MODE (e->u.val_rtx, mode);
714   CSELIB_VAL_PTR (e->u.val_rtx) = e;
715   e->addr_list = 0;
716   e->locs = 0;
717   e->next_containing_mem = 0;
718   return e;
719 }
720
721 /* ADDR_ELT is a value that is used as address.  MEM_ELT is the value that
722    contains the data at this address.  X is a MEM that represents the
723    value.  Update the two value structures to represent this situation.  */
724
725 static void
726 add_mem_for_addr (cselib_val *addr_elt, cselib_val *mem_elt, rtx x)
727 {
728   struct elt_loc_list *l;
729
730   /* Avoid duplicates.  */
731   for (l = mem_elt->locs; l; l = l->next)
732     if (MEM_P (l->loc)
733         && CSELIB_VAL_PTR (XEXP (l->loc, 0)) == addr_elt)
734       return;
735
736   addr_elt->addr_list = new_elt_list (addr_elt->addr_list, mem_elt);
737   mem_elt->locs
738     = new_elt_loc_list (mem_elt->locs,
739                         replace_equiv_address_nv (x, addr_elt->u.val_rtx));
740   if (mem_elt->next_containing_mem == NULL)
741     {
742       mem_elt->next_containing_mem = first_containing_mem;
743       first_containing_mem = mem_elt;
744     }
745 }
746
747 /* Subroutine of cselib_lookup.  Return a value for X, which is a MEM rtx.
748    If CREATE, make a new one if we haven't seen it before.  */
749
750 static cselib_val *
751 cselib_lookup_mem (rtx x, int create)
752 {
753   enum machine_mode mode = GET_MODE (x);
754   void **slot;
755   cselib_val *addr;
756   cselib_val *mem_elt;
757   struct elt_list *l;
758
759   if (MEM_VOLATILE_P (x) || mode == BLKmode
760       || !cselib_record_memory
761       || (FLOAT_MODE_P (mode) && flag_float_store))
762     return 0;
763
764   /* Look up the value for the address.  */
765   addr = cselib_lookup (XEXP (x, 0), mode, create);
766   if (! addr)
767     return 0;
768
769   /* Find a value that describes a value of our mode at that address.  */
770   for (l = addr->addr_list; l; l = l->next)
771     if (GET_MODE (l->elt->u.val_rtx) == mode)
772       return l->elt;
773
774   if (! create)
775     return 0;
776
777   mem_elt = new_cselib_val (++next_unknown_value, mode);
778   add_mem_for_addr (addr, mem_elt, x);
779   slot = htab_find_slot_with_hash (hash_table, wrap_constant (mode, x),
780                                    mem_elt->value, INSERT);
781   *slot = mem_elt;
782   return mem_elt;
783 }
784
785 /* Walk rtx X and replace all occurrences of REG and MEM subexpressions
786    with VALUE expressions.  This way, it becomes independent of changes
787    to registers and memory.
788    X isn't actually modified; if modifications are needed, new rtl is
789    allocated.  However, the return value can share rtl with X.  */
790
791 rtx
792 cselib_subst_to_values (rtx x)
793 {
794   enum rtx_code code = GET_CODE (x);
795   const char *fmt = GET_RTX_FORMAT (code);
796   cselib_val *e;
797   struct elt_list *l;
798   rtx copy = x;
799   int i;
800
801   switch (code)
802     {
803     case REG:
804       l = REG_VALUES (REGNO (x));
805       if (l && l->elt == NULL)
806         l = l->next;
807       for (; l; l = l->next)
808         if (GET_MODE (l->elt->u.val_rtx) == GET_MODE (x))
809           return l->elt->u.val_rtx;
810
811       gcc_unreachable ();
812
813     case MEM:
814       e = cselib_lookup_mem (x, 0);
815       if (! e)
816         {
817           /* This happens for autoincrements.  Assign a value that doesn't
818              match any other.  */
819           e = new_cselib_val (++next_unknown_value, GET_MODE (x));
820         }
821       return e->u.val_rtx;
822
823     case CONST_DOUBLE:
824     case CONST_VECTOR:
825     case CONST_INT:
826       return x;
827
828     case POST_INC:
829     case PRE_INC:
830     case POST_DEC:
831     case PRE_DEC:
832     case POST_MODIFY:
833     case PRE_MODIFY:
834       e = new_cselib_val (++next_unknown_value, GET_MODE (x));
835       return e->u.val_rtx;
836
837     default:
838       break;
839     }
840
841   for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
842     {
843       if (fmt[i] == 'e')
844         {
845           rtx t = cselib_subst_to_values (XEXP (x, i));
846
847           if (t != XEXP (x, i) && x == copy)
848             copy = shallow_copy_rtx (x);
849
850           XEXP (copy, i) = t;
851         }
852       else if (fmt[i] == 'E')
853         {
854           int j, k;
855
856           for (j = 0; j < XVECLEN (x, i); j++)
857             {
858               rtx t = cselib_subst_to_values (XVECEXP (x, i, j));
859
860               if (t != XVECEXP (x, i, j) && XVEC (x, i) == XVEC (copy, i))
861                 {
862                   if (x == copy)
863                     copy = shallow_copy_rtx (x);
864
865                   XVEC (copy, i) = rtvec_alloc (XVECLEN (x, i));
866                   for (k = 0; k < j; k++)
867                     XVECEXP (copy, i, k) = XVECEXP (x, i, k);
868                 }
869
870               XVECEXP (copy, i, j) = t;
871             }
872         }
873     }
874
875   return copy;
876 }
877
878 /* Look up the rtl expression X in our tables and return the value it has.
879    If CREATE is zero, we return NULL if we don't know the value.  Otherwise,
880    we create a new one if possible, using mode MODE if X doesn't have a mode
881    (i.e. because it's a constant).  */
882
883 cselib_val *
884 cselib_lookup (rtx x, enum machine_mode mode, int create)
885 {
886   void **slot;
887   cselib_val *e;
888   unsigned int hashval;
889
890   if (GET_MODE (x) != VOIDmode)
891     mode = GET_MODE (x);
892
893   if (GET_CODE (x) == VALUE)
894     return CSELIB_VAL_PTR (x);
895
896   if (REG_P (x))
897     {
898       struct elt_list *l;
899       unsigned int i = REGNO (x);
900
901       l = REG_VALUES (i);
902       if (l && l->elt == NULL)
903         l = l->next;
904       for (; l; l = l->next)
905         if (mode == GET_MODE (l->elt->u.val_rtx))
906           return l->elt;
907
908       if (! create)
909         return 0;
910
911       if (i < FIRST_PSEUDO_REGISTER)
912         {
913           unsigned int n = hard_regno_nregs[i][mode];
914
915           if (n > max_value_regs)
916             max_value_regs = n;
917         }
918
919       e = new_cselib_val (++next_unknown_value, GET_MODE (x));
920       e->locs = new_elt_loc_list (e->locs, x);
921       if (REG_VALUES (i) == 0)
922         {
923           /* Maintain the invariant that the first entry of
924              REG_VALUES, if present, must be the value used to set the
925              register, or NULL.  */
926           used_regs[n_used_regs++] = i;
927           REG_VALUES (i) = new_elt_list (REG_VALUES (i), NULL);
928         }
929       REG_VALUES (i)->next = new_elt_list (REG_VALUES (i)->next, e);
930       slot = htab_find_slot_with_hash (hash_table, x, e->value, INSERT);
931       *slot = e;
932       return e;
933     }
934
935   if (MEM_P (x))
936     return cselib_lookup_mem (x, create);
937
938   hashval = cselib_hash_rtx (x, mode, create);
939   /* Can't even create if hashing is not possible.  */
940   if (! hashval)
941     return 0;
942
943   slot = htab_find_slot_with_hash (hash_table, wrap_constant (mode, x),
944                                    hashval, create ? INSERT : NO_INSERT);
945   if (slot == 0)
946     return 0;
947
948   e = (cselib_val *) *slot;
949   if (e)
950     return e;
951
952   e = new_cselib_val (hashval, mode);
953
954   /* We have to fill the slot before calling cselib_subst_to_values:
955      the hash table is inconsistent until we do so, and
956      cselib_subst_to_values will need to do lookups.  */
957   *slot = (void *) e;
958   e->locs = new_elt_loc_list (e->locs, cselib_subst_to_values (x));
959   return e;
960 }
961
962 /* Invalidate any entries in reg_values that overlap REGNO.  This is called
963    if REGNO is changing.  MODE is the mode of the assignment to REGNO, which
964    is used to determine how many hard registers are being changed.  If MODE
965    is VOIDmode, then only REGNO is being changed; this is used when
966    invalidating call clobbered registers across a call.  */
967
968 static void
969 cselib_invalidate_regno (unsigned int regno, enum machine_mode mode)
970 {
971   unsigned int endregno;
972   unsigned int i;
973
974   /* If we see pseudos after reload, something is _wrong_.  */
975   gcc_assert (!reload_completed || regno < FIRST_PSEUDO_REGISTER
976               || reg_renumber[regno] < 0);
977
978   /* Determine the range of registers that must be invalidated.  For
979      pseudos, only REGNO is affected.  For hard regs, we must take MODE
980      into account, and we must also invalidate lower register numbers
981      if they contain values that overlap REGNO.  */
982   if (regno < FIRST_PSEUDO_REGISTER)
983     {
984       gcc_assert (mode != VOIDmode);
985
986       if (regno < max_value_regs)
987         i = 0;
988       else
989         i = regno - max_value_regs;
990
991       endregno = regno + hard_regno_nregs[regno][mode];
992     }
993   else
994     {
995       i = regno;
996       endregno = regno + 1;
997     }
998
999   for (; i < endregno; i++)
1000     {
1001       struct elt_list **l = &REG_VALUES (i);
1002
1003       /* Go through all known values for this reg; if it overlaps the range
1004          we're invalidating, remove the value.  */
1005       while (*l)
1006         {
1007           cselib_val *v = (*l)->elt;
1008           struct elt_loc_list **p;
1009           unsigned int this_last = i;
1010
1011           if (i < FIRST_PSEUDO_REGISTER && v != NULL)
1012             this_last += hard_regno_nregs[i][GET_MODE (v->u.val_rtx)] - 1;
1013
1014           if (this_last < regno || v == NULL)
1015             {
1016               l = &(*l)->next;
1017               continue;
1018             }
1019
1020           /* We have an overlap.  */
1021           if (*l == REG_VALUES (i))
1022             {
1023               /* Maintain the invariant that the first entry of
1024                  REG_VALUES, if present, must be the value used to set
1025                  the register, or NULL.  This is also nice because
1026                  then we won't push the same regno onto user_regs
1027                  multiple times.  */
1028               (*l)->elt = NULL;
1029               l = &(*l)->next;
1030             }
1031           else
1032             unchain_one_elt_list (l);
1033
1034           /* Now, we clear the mapping from value to reg.  It must exist, so
1035              this code will crash intentionally if it doesn't.  */
1036           for (p = &v->locs; ; p = &(*p)->next)
1037             {
1038               rtx x = (*p)->loc;
1039
1040               if (REG_P (x) && REGNO (x) == i)
1041                 {
1042                   unchain_one_elt_loc_list (p);
1043                   break;
1044                 }
1045             }
1046           if (v->locs == 0)
1047             n_useless_values++;
1048         }
1049     }
1050 }
1051 \f
1052 /* Return 1 if X has a value that can vary even between two
1053    executions of the program.  0 means X can be compared reliably
1054    against certain constants or near-constants.  */
1055
1056 static int
1057 cselib_rtx_varies_p (rtx x ATTRIBUTE_UNUSED, int from_alias ATTRIBUTE_UNUSED)
1058 {
1059   /* We actually don't need to verify very hard.  This is because
1060      if X has actually changed, we invalidate the memory anyway,
1061      so assume that all common memory addresses are
1062      invariant.  */
1063   return 0;
1064 }
1065
1066 /* Invalidate any locations in the table which are changed because of a
1067    store to MEM_RTX.  If this is called because of a non-const call
1068    instruction, MEM_RTX is (mem:BLK const0_rtx).  */
1069
1070 static void
1071 cselib_invalidate_mem (rtx mem_rtx)
1072 {
1073   cselib_val **vp, *v, *next;
1074   int num_mems = 0;
1075   rtx mem_addr;
1076
1077   mem_addr = canon_rtx (get_addr (XEXP (mem_rtx, 0)));
1078   mem_rtx = canon_rtx (mem_rtx);
1079
1080   vp = &first_containing_mem;
1081   for (v = *vp; v != &dummy_val; v = next)
1082     {
1083       bool has_mem = false;
1084       struct elt_loc_list **p = &v->locs;
1085       int had_locs = v->locs != 0;
1086
1087       while (*p)
1088         {
1089           rtx x = (*p)->loc;
1090           cselib_val *addr;
1091           struct elt_list **mem_chain;
1092
1093           /* MEMs may occur in locations only at the top level; below
1094              that every MEM or REG is substituted by its VALUE.  */
1095           if (!MEM_P (x))
1096             {
1097               p = &(*p)->next;
1098               continue;
1099             }
1100           if (num_mems < PARAM_VALUE (PARAM_MAX_CSELIB_MEMORY_LOCATIONS)
1101               && ! canon_true_dependence (mem_rtx, GET_MODE (mem_rtx), mem_addr,
1102                                           x, cselib_rtx_varies_p))
1103             {
1104               has_mem = true;
1105               num_mems++;
1106               p = &(*p)->next;
1107               continue;
1108             }
1109
1110           /* This one overlaps.  */
1111           /* We must have a mapping from this MEM's address to the
1112              value (E).  Remove that, too.  */
1113           addr = cselib_lookup (XEXP (x, 0), VOIDmode, 0);
1114           mem_chain = &addr->addr_list;
1115           for (;;)
1116             {
1117               if ((*mem_chain)->elt == v)
1118                 {
1119                   unchain_one_elt_list (mem_chain);
1120                   break;
1121                 }
1122
1123               mem_chain = &(*mem_chain)->next;
1124             }
1125
1126           unchain_one_elt_loc_list (p);
1127         }
1128
1129       if (had_locs && v->locs == 0)
1130         n_useless_values++;
1131
1132       next = v->next_containing_mem;
1133       if (has_mem)
1134         {
1135           *vp = v;
1136           vp = &(*vp)->next_containing_mem;
1137         }
1138       else
1139         v->next_containing_mem = NULL;
1140     }
1141   *vp = &dummy_val;
1142 }
1143
1144 /* Invalidate DEST, which is being assigned to or clobbered.  The second and
1145    the third parameter exist so that this function can be passed to
1146    note_stores; they are ignored.  */
1147
1148 static void
1149 cselib_invalidate_rtx (rtx dest, rtx ignore ATTRIBUTE_UNUSED,
1150                        void *data ATTRIBUTE_UNUSED)
1151 {
1152   while (GET_CODE (dest) == STRICT_LOW_PART || GET_CODE (dest) == SIGN_EXTRACT
1153          || GET_CODE (dest) == ZERO_EXTRACT || GET_CODE (dest) == SUBREG)
1154     dest = XEXP (dest, 0);
1155
1156   if (REG_P (dest))
1157     cselib_invalidate_regno (REGNO (dest), GET_MODE (dest));
1158   else if (MEM_P (dest))
1159     cselib_invalidate_mem (dest);
1160
1161   /* Some machines don't define AUTO_INC_DEC, but they still use push
1162      instructions.  We need to catch that case here in order to
1163      invalidate the stack pointer correctly.  Note that invalidating
1164      the stack pointer is different from invalidating DEST.  */
1165   if (push_operand (dest, GET_MODE (dest)))
1166     cselib_invalidate_rtx (stack_pointer_rtx, NULL_RTX, NULL);
1167 }
1168
1169 /* Record the result of a SET instruction.  DEST is being set; the source
1170    contains the value described by SRC_ELT.  If DEST is a MEM, DEST_ADDR_ELT
1171    describes its address.  */
1172
1173 static void
1174 cselib_record_set (rtx dest, cselib_val *src_elt, cselib_val *dest_addr_elt)
1175 {
1176   int dreg = REG_P (dest) ? (int) REGNO (dest) : -1;
1177
1178   if (src_elt == 0 || side_effects_p (dest))
1179     return;
1180
1181   if (dreg >= 0)
1182     {
1183       if (dreg < FIRST_PSEUDO_REGISTER)
1184         {
1185           unsigned int n = hard_regno_nregs[dreg][GET_MODE (dest)];
1186
1187           if (n > max_value_regs)
1188             max_value_regs = n;
1189         }
1190
1191       if (REG_VALUES (dreg) == 0)
1192         {
1193           used_regs[n_used_regs++] = dreg;
1194           REG_VALUES (dreg) = new_elt_list (REG_VALUES (dreg), src_elt);
1195         }
1196       else
1197         {
1198           /* The register should have been invalidated.  */
1199           gcc_assert (REG_VALUES (dreg)->elt == 0);
1200           REG_VALUES (dreg)->elt = src_elt;
1201         }
1202
1203       if (src_elt->locs == 0)
1204         n_useless_values--;
1205       src_elt->locs = new_elt_loc_list (src_elt->locs, dest);
1206     }
1207   else if (MEM_P (dest) && dest_addr_elt != 0
1208            && cselib_record_memory)
1209     {
1210       if (src_elt->locs == 0)
1211         n_useless_values--;
1212       add_mem_for_addr (dest_addr_elt, src_elt, dest);
1213     }
1214 }
1215
1216 /* Describe a single set that is part of an insn.  */
1217 struct set
1218 {
1219   rtx src;
1220   rtx dest;
1221   cselib_val *src_elt;
1222   cselib_val *dest_addr_elt;
1223 };
1224
1225 /* There is no good way to determine how many elements there can be
1226    in a PARALLEL.  Since it's fairly cheap, use a really large number.  */
1227 #define MAX_SETS (FIRST_PSEUDO_REGISTER * 2)
1228
1229 /* Record the effects of any sets in INSN.  */
1230 static void
1231 cselib_record_sets (rtx insn)
1232 {
1233   int n_sets = 0;
1234   int i;
1235   struct set sets[MAX_SETS];
1236   rtx body = PATTERN (insn);
1237   rtx cond = 0;
1238
1239   body = PATTERN (insn);
1240   if (GET_CODE (body) == COND_EXEC)
1241     {
1242       cond = COND_EXEC_TEST (body);
1243       body = COND_EXEC_CODE (body);
1244     }
1245
1246   /* Find all sets.  */
1247   if (GET_CODE (body) == SET)
1248     {
1249       sets[0].src = SET_SRC (body);
1250       sets[0].dest = SET_DEST (body);
1251       n_sets = 1;
1252     }
1253   else if (GET_CODE (body) == PARALLEL)
1254     {
1255       /* Look through the PARALLEL and record the values being
1256          set, if possible.  Also handle any CLOBBERs.  */
1257       for (i = XVECLEN (body, 0) - 1; i >= 0; --i)
1258         {
1259           rtx x = XVECEXP (body, 0, i);
1260
1261           if (GET_CODE (x) == SET)
1262             {
1263               sets[n_sets].src = SET_SRC (x);
1264               sets[n_sets].dest = SET_DEST (x);
1265               n_sets++;
1266             }
1267         }
1268     }
1269
1270   /* Look up the values that are read.  Do this before invalidating the
1271      locations that are written.  */
1272   for (i = 0; i < n_sets; i++)
1273     {
1274       rtx dest = sets[i].dest;
1275
1276       /* A STRICT_LOW_PART can be ignored; we'll record the equivalence for
1277          the low part after invalidating any knowledge about larger modes.  */
1278       if (GET_CODE (sets[i].dest) == STRICT_LOW_PART)
1279         sets[i].dest = dest = XEXP (dest, 0);
1280
1281       /* We don't know how to record anything but REG or MEM.  */
1282       if (REG_P (dest)
1283           || (MEM_P (dest) && cselib_record_memory))
1284         {
1285           rtx src = sets[i].src;
1286           if (cond)
1287             src = gen_rtx_IF_THEN_ELSE (GET_MODE (src), cond, src, dest);
1288           sets[i].src_elt = cselib_lookup (src, GET_MODE (dest), 1);
1289           if (MEM_P (dest))
1290             sets[i].dest_addr_elt = cselib_lookup (XEXP (dest, 0), Pmode, 1);
1291           else
1292             sets[i].dest_addr_elt = 0;
1293         }
1294     }
1295
1296   /* Invalidate all locations written by this insn.  Note that the elts we
1297      looked up in the previous loop aren't affected, just some of their
1298      locations may go away.  */
1299   note_stores (body, cselib_invalidate_rtx, NULL);
1300
1301   /* If this is an asm, look for duplicate sets.  This can happen when the
1302      user uses the same value as an output multiple times.  This is valid
1303      if the outputs are not actually used thereafter.  Treat this case as
1304      if the value isn't actually set.  We do this by smashing the destination
1305      to pc_rtx, so that we won't record the value later.  */
1306   if (n_sets >= 2 && asm_noperands (body) >= 0)
1307     {
1308       for (i = 0; i < n_sets; i++)
1309         {
1310           rtx dest = sets[i].dest;
1311           if (REG_P (dest) || MEM_P (dest))
1312             {
1313               int j;
1314               for (j = i + 1; j < n_sets; j++)
1315                 if (rtx_equal_p (dest, sets[j].dest))
1316                   {
1317                     sets[i].dest = pc_rtx;
1318                     sets[j].dest = pc_rtx;
1319                   }
1320             }
1321         }
1322     }
1323
1324   /* Now enter the equivalences in our tables.  */
1325   for (i = 0; i < n_sets; i++)
1326     {
1327       rtx dest = sets[i].dest;
1328       if (REG_P (dest)
1329           || (MEM_P (dest) && cselib_record_memory))
1330         cselib_record_set (dest, sets[i].src_elt, sets[i].dest_addr_elt);
1331     }
1332 }
1333
1334 /* Record the effects of INSN.  */
1335
1336 void
1337 cselib_process_insn (rtx insn)
1338 {
1339   int i;
1340   rtx x;
1341
1342   if (find_reg_note (insn, REG_LIBCALL, NULL))
1343     cselib_current_insn_in_libcall = true;
1344   if (find_reg_note (insn, REG_RETVAL, NULL))
1345     cselib_current_insn_in_libcall = false;
1346   cselib_current_insn = insn;
1347
1348   /* Forget everything at a CODE_LABEL, a volatile asm, or a setjmp.  */
1349   if (LABEL_P (insn)
1350       || (CALL_P (insn)
1351           && find_reg_note (insn, REG_SETJMP, NULL))
1352       || (NONJUMP_INSN_P (insn)
1353           && GET_CODE (PATTERN (insn)) == ASM_OPERANDS
1354           && MEM_VOLATILE_P (PATTERN (insn))))
1355     {
1356       clear_table ();
1357       return;
1358     }
1359
1360   if (! INSN_P (insn))
1361     {
1362       cselib_current_insn = 0;
1363       return;
1364     }
1365
1366   /* If this is a call instruction, forget anything stored in a
1367      call clobbered register, or, if this is not a const call, in
1368      memory.  */
1369   if (CALL_P (insn))
1370     {
1371       for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
1372         if (call_used_regs[i])
1373           cselib_invalidate_regno (i, reg_raw_mode[i]);
1374
1375       if (! CONST_OR_PURE_CALL_P (insn))
1376         cselib_invalidate_mem (callmem);
1377     }
1378
1379   cselib_record_sets (insn);
1380
1381 #ifdef AUTO_INC_DEC
1382   /* Clobber any registers which appear in REG_INC notes.  We
1383      could keep track of the changes to their values, but it is
1384      unlikely to help.  */
1385   for (x = REG_NOTES (insn); x; x = XEXP (x, 1))
1386     if (REG_NOTE_KIND (x) == REG_INC)
1387       cselib_invalidate_rtx (XEXP (x, 0), NULL_RTX, NULL);
1388 #endif
1389
1390   /* Look for any CLOBBERs in CALL_INSN_FUNCTION_USAGE, but only
1391      after we have processed the insn.  */
1392   if (CALL_P (insn))
1393     for (x = CALL_INSN_FUNCTION_USAGE (insn); x; x = XEXP (x, 1))
1394       if (GET_CODE (XEXP (x, 0)) == CLOBBER)
1395         cselib_invalidate_rtx (XEXP (XEXP (x, 0), 0), NULL_RTX, NULL);
1396
1397   cselib_current_insn = 0;
1398
1399   if (n_useless_values > MAX_USELESS_VALUES)
1400     remove_useless_values ();
1401 }
1402
1403 /* Initialize cselib for one pass.  The caller must also call
1404    init_alias_analysis.  */
1405
1406 void
1407 cselib_init (bool record_memory)
1408 {
1409   elt_list_pool = create_alloc_pool ("elt_list", 
1410                                      sizeof (struct elt_list), 10);
1411   elt_loc_list_pool = create_alloc_pool ("elt_loc_list", 
1412                                          sizeof (struct elt_loc_list), 10);
1413   cselib_val_pool = create_alloc_pool ("cselib_val_list", 
1414                                        sizeof (cselib_val), 10);
1415   value_pool = create_alloc_pool ("value", 
1416                                   RTX_SIZE (VALUE), 100);
1417   cselib_record_memory = record_memory;
1418   /* This is only created once.  */
1419   if (! callmem)
1420     callmem = gen_rtx_MEM (BLKmode, const0_rtx);
1421
1422   cselib_nregs = max_reg_num ();
1423
1424   /* We preserve reg_values to allow expensive clearing of the whole thing.
1425      Reallocate it however if it happens to be too large.  */
1426   if (!reg_values || reg_values_size < cselib_nregs
1427       || (reg_values_size > 10 && reg_values_size > cselib_nregs * 4))
1428     {
1429       if (reg_values)
1430         free (reg_values);
1431       /* Some space for newly emit instructions so we don't end up
1432          reallocating in between passes.  */
1433       reg_values_size = cselib_nregs + (63 + cselib_nregs) / 16;
1434       reg_values = xcalloc (reg_values_size, sizeof (reg_values));
1435     }
1436   used_regs = xmalloc (sizeof (*used_regs) * cselib_nregs);
1437   n_used_regs = 0;
1438   hash_table = htab_create (31, get_value_hash, entry_and_rtx_equal_p, NULL);
1439   cselib_current_insn_in_libcall = false;
1440 }
1441
1442 /* Called when the current user is done with cselib.  */
1443
1444 void
1445 cselib_finish (void)
1446 {
1447   free_alloc_pool (elt_list_pool);
1448   free_alloc_pool (elt_loc_list_pool);
1449   free_alloc_pool (cselib_val_pool);
1450   free_alloc_pool (value_pool);
1451   clear_table ();
1452   htab_delete (hash_table);
1453   free (used_regs);
1454   used_regs = 0;
1455   hash_table = 0;
1456   n_useless_values = 0;
1457   next_unknown_value = 0;
1458 }
1459
1460 #include "gt-cselib.h"