[multiple changes]
[platform/upstream/gcc.git] / gcc / dse.c
index 2bb20d7..86d0589 100644 (file)
--- a/gcc/dse.c
+++ b/gcc/dse.c
@@ -25,41 +25,24 @@ along with GCC; see the file COPYING3.  If not see
 #include "config.h"
 #include "system.h"
 #include "coretypes.h"
-#include "hash-table.h"
-#include "tm.h"
+#include "backend.h"
+#include "predict.h"
+#include "tree.h"
+#include "gimple.h"
 #include "rtl.h"
-#include "hash-set.h"
-#include "machmode.h"
-#include "vec.h"
-#include "double-int.h"
-#include "input.h"
+#include "df.h"
 #include "alias.h"
-#include "symtab.h"
-#include "wide-int.h"
-#include "inchash.h"
-#include "real.h"
-#include "tree.h"
 #include "fold-const.h"
 #include "stor-layout.h"
 #include "tm_p.h"
 #include "regs.h"
-#include "hard-reg-set.h"
 #include "regset.h"
 #include "flags.h"
-#include "dominance.h"
-#include "cfg.h"
 #include "cfgrtl.h"
-#include "predict.h"
-#include "basic-block.h"
-#include "df.h"
 #include "cselib.h"
 #include "tree-pass.h"
 #include "alloc-pool.h"
 #include "insn-config.h"
-#include "hashtab.h"
-#include "function.h"
-#include "statistics.h"
-#include "fixed-value.h"
 #include "expmed.h"
 #include "dojump.h"
 #include "explow.h"
@@ -74,11 +57,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "dbgcnt.h"
 #include "target.h"
 #include "params.h"
-#include "tree-ssa-alias.h"
 #include "internal-fn.h"
-#include "gimple-expr.h"
-#include "is-a.h"
-#include "gimple.h"
 #include "gimple-ssa.h"
 #include "rtl-iter.h"
 #include "cfgcleanup.h"
@@ -96,7 +75,7 @@ along with GCC; see the file COPYING3.  If not see
    frame_pointer.
 
    * The third technique, (which is only done after register allocation)
-   processes the spill spill slots.  This differs from the second
+   processes the spill slots.  This differs from the second
    technique because it takes advantage of the fact that spilling is
    completely free from the effects of aliasing.
 
@@ -249,7 +228,7 @@ static struct obstack dse_obstack;
 /* Scratch bitmap for cselib's cselib_expand_value_rtx.  */
 static bitmap scratch = NULL;
 
-struct insn_info;
+struct insn_info_type;
 
 /* This structure holds information about a candidate store.  */
 struct store_info
@@ -316,7 +295,7 @@ struct store_info
   /* Set if this store stores the same constant value as REDUNDANT_REASON
      insn stored.  These aren't eliminated early, because doing that
      might prevent the earlier larger store to be eliminated.  */
-  struct insn_info *redundant_reason;
+  struct insn_info_type *redundant_reason;
 };
 
 /* Return a bitmask with the first N low bits set.  */
@@ -328,13 +307,13 @@ lowpart_bitmask (int n)
   return mask >> (HOST_BITS_PER_WIDE_INT - n);
 }
 
-typedef struct store_info *store_info_t;
-static alloc_pool cse_store_info_pool;
-static alloc_pool rtx_store_info_pool;
+static object_allocator<store_info> cse_store_info_pool ("cse_store_info_pool");
+
+static object_allocator<store_info> rtx_store_info_pool ("rtx_store_info_pool");
 
 /* This structure holds information about a load.  These are only
    built for rtx bases.  */
-struct read_info
+struct read_info_type
 {
   /* The id of the mem group of the base address.  */
   int group_id;
@@ -351,15 +330,15 @@ struct read_info
   rtx mem;
 
   /* The next read_info for this insn.  */
-  struct read_info *next;
+  struct read_info_type *next;
 };
-typedef struct read_info *read_info_t;
-static alloc_pool read_info_pool;
+typedef struct read_info_type *read_info_t;
 
+static object_allocator<read_info_type> read_info_type_pool ("read_info_pool");
 
 /* One of these records is created for each insn.  */
 
-struct insn_info
+struct insn_info_type
 {
   /* Set true if the insn contains a store but the insn itself cannot
      be deleted.  This is set if the insn is a parallel and there is
@@ -417,7 +396,7 @@ struct insn_info
      But it could also contain clobbers.  Insns that contain more than
      one mem set are not deletable, but each of those mems are here in
      order to provide info to delete other insns.  */
-  store_info_t store_rec;
+  store_info *store_rec;
 
   /* The linked list of mem uses in this insn.  Only the reads from
      rtx bases are listed here.  The reads to cselib bases are
@@ -433,27 +412,26 @@ struct insn_info
   regset fixed_regs_live;
 
   /* The prev insn in the basic block.  */
-  struct insn_info * prev_insn;
+  struct insn_info_type * prev_insn;
 
   /* The linked list of insns that are in consideration for removal in
      the forwards pass through the basic block.  This pointer may be
      trash as it is not cleared when a wild read occurs.  The only
      time it is guaranteed to be correct is when the traversal starts
      at active_local_stores.  */
-  struct insn_info * next_local_store;
+  struct insn_info_type * next_local_store;
 };
+typedef struct insn_info_type *insn_info_t;
 
-typedef struct insn_info *insn_info_t;
-static alloc_pool insn_info_pool;
+static object_allocator<insn_info_type> insn_info_type_pool ("insn_info_pool");
 
 /* The linked list of stores that are under consideration in this
    basic block.  */
 static insn_info_t active_local_stores;
 static int active_local_stores_len;
 
-struct dse_bb_info
+struct dse_bb_info_type
 {
-
   /* Pointer to the insn info for the last insn in the block.  These
      are linked so this is how all of the insns are reached.  During
      scanning this is the current insn being scanned.  */
@@ -509,8 +487,10 @@ struct dse_bb_info
   bitmap regs_live;
 };
 
-typedef struct dse_bb_info *bb_info_t;
-static alloc_pool bb_info_pool;
+typedef struct dse_bb_info_type *bb_info_t;
+
+static object_allocator<dse_bb_info_type> dse_bb_info_type_pool
+  ("bb_info_pool");
 
 /* Table to hold all bb_infos.  */
 static bb_info_t *bb_table;
@@ -579,15 +559,14 @@ struct group_info
   int *offset_map_n, *offset_map_p;
   int offset_map_size_n, offset_map_size_p;
 };
-typedef struct group_info *group_info_t;
-typedef const struct group_info *const_group_info_t;
-static alloc_pool rtx_group_info_pool;
+
+static object_allocator<group_info> group_info_pool ("rtx_group_info_pool");
 
 /* Index into the rtx_group_vec.  */
 static int rtx_group_next_id;
 
 
-static vec<group_info_t> rtx_group_vec;
+static vec<group_info *> rtx_group_vec;
 
 
 /* This structure holds the set of changes that are being deferred
@@ -604,13 +583,13 @@ struct deferred_change
   struct deferred_change *next;
 };
 
-typedef struct deferred_change *deferred_change_t;
-static alloc_pool deferred_change_pool;
+static object_allocator<deferred_change> deferred_change_pool
+  ("deferred_change_pool");
 
-static deferred_change_t deferred_change_list = NULL;
+static deferred_change *deferred_change_list = NULL;
 
 /* The group that holds all of the clear_alias_sets.  */
-static group_info_t clear_alias_group;
+static group_info *clear_alias_group;
 
 /* The modes of the clear_alias_sets.  */
 static htab_t clear_alias_mode_table;
@@ -665,23 +644,21 @@ clear_alias_set_lookup (alias_set_type alias_set)
 /* Hashtable callbacks for maintaining the "bases" field of
    store_group_info, given that the addresses are function invariants.  */
 
-struct invariant_group_base_hasher : typed_noop_remove <group_info>
+struct invariant_group_base_hasher : nofree_ptr_hash <group_info>
 {
-  typedef group_info value_type;
-  typedef group_info compare_type;
-  static inline hashval_t hash (const value_type *);
-  static inline bool equal (const value_type *, const compare_type *);
+  static inline hashval_t hash (const group_info *);
+  static inline bool equal (const group_info *, const group_info *);
 };
 
 inline bool
-invariant_group_base_hasher::equal (const value_type *gi1,
-                                   const compare_type *gi2)
+invariant_group_base_hasher::equal (const group_info *gi1,
+                                   const group_info *gi2)
 {
   return rtx_equal_p (gi1->rtx_base, gi2->rtx_base);
 }
 
 inline hashval_t
-invariant_group_base_hasher::hash (const value_type *gi)
+invariant_group_base_hasher::hash (const group_info *gi)
 {
   int do_not_record;
   return hash_rtx (gi->rtx_base, Pmode, &do_not_record, NULL, false);
@@ -693,11 +670,11 @@ static hash_table<invariant_group_base_hasher> *rtx_group_table;
 
 /* Get the GROUP for BASE.  Add a new group if it is not there.  */
 
-static group_info_t
+static group_info *
 get_group_info (rtx base)
 {
   struct group_info tmp_gi;
-  group_info_t gi;
+  group_info *gi;
   group_info **slot;
 
   if (base)
@@ -706,14 +683,13 @@ get_group_info (rtx base)
         if necessary.  */
       tmp_gi.rtx_base = base;
       slot = rtx_group_table->find_slot (&tmp_gi, INSERT);
-      gi = (group_info_t) *slot;
+      gi = *slot;
     }
   else
     {
       if (!clear_alias_group)
        {
-         clear_alias_group = gi =
-           (group_info_t) pool_alloc (rtx_group_info_pool);
+         clear_alias_group = gi = group_info_pool.allocate ();
          memset (gi, 0, sizeof (struct group_info));
          gi->id = rtx_group_next_id++;
          gi->store1_n = BITMAP_ALLOC (&dse_bitmap_obstack);
@@ -735,7 +711,7 @@ get_group_info (rtx base)
 
   if (gi == NULL)
     {
-      *slot = gi = (group_info_t) pool_alloc (rtx_group_info_pool);
+      *slot = gi = group_info_pool.allocate ();
       gi->rtx_base = base;
       gi->id = rtx_group_next_id++;
       gi->base_mem = gen_rtx_MEM (BLKmode, base);
@@ -776,24 +752,6 @@ dse_step0 (void)
   scratch = BITMAP_ALLOC (&reg_obstack);
   kill_on_calls = BITMAP_ALLOC (&dse_bitmap_obstack);
 
-  rtx_store_info_pool
-    = create_alloc_pool ("rtx_store_info_pool",
-                        sizeof (struct store_info), 100);
-  read_info_pool
-    = create_alloc_pool ("read_info_pool",
-                        sizeof (struct read_info), 100);
-  insn_info_pool
-    = create_alloc_pool ("insn_info_pool",
-                        sizeof (struct insn_info), 100);
-  bb_info_pool
-    = create_alloc_pool ("bb_info_pool",
-                        sizeof (struct dse_bb_info), 100);
-  rtx_group_info_pool
-    = create_alloc_pool ("rtx_group_info_pool",
-                        sizeof (struct group_info), 100);
-  deferred_change_pool
-    = create_alloc_pool ("deferred_change_pool",
-                        sizeof (struct deferred_change), 10);
 
   rtx_group_table = new hash_table<invariant_group_base_hasher> (11);
 
@@ -822,17 +780,17 @@ dse_step0 (void)
 static void
 free_store_info (insn_info_t insn_info)
 {
-  store_info_t store_info = insn_info->store_rec;
-  while (store_info)
+  store_info *cur = insn_info->store_rec;
+  while (cur)
     {
-      store_info_t next = store_info->next;
-      if (store_info->is_large)
-       BITMAP_FREE (store_info->positions_needed.large.bmap);
-      if (store_info->cse_base)
-       pool_free (cse_store_info_pool, store_info);
+      store_info *next = cur->next;
+      if (cur->is_large)
+       BITMAP_FREE (cur->positions_needed.large.bmap);
+      if (cur->cse_base)
+       cse_store_info_pool.remove (cur);
       else
-       pool_free (rtx_store_info_pool, store_info);
-      store_info = next;
+       rtx_store_info_pool.remove (cur);
+      cur = next;
     }
 
   insn_info->cannot_delete = true;
@@ -840,12 +798,12 @@ free_store_info (insn_info_t insn_info)
   insn_info->store_rec = NULL;
 }
 
-typedef struct
+struct note_add_store_info
 {
   rtx_insn *first, *current;
   regset fixed_regs_live;
   bool failure;
-} note_add_store_info;
+};
 
 /* Callback for emit_inc_dec_insn_before via note_stores.
    Check if a register is clobbered which is live afterwards.  */
@@ -855,7 +813,6 @@ note_add_store (rtx loc, const_rtx expr ATTRIBUTE_UNUSED, void *data)
 {
   rtx_insn *insn;
   note_add_store_info *info = (note_add_store_info *) data;
-  int r, n;
 
   if (!REG_P (loc))
     return;
@@ -874,15 +831,14 @@ note_add_store (rtx loc, const_rtx expr ATTRIBUTE_UNUSED, void *data)
      available, fail now.  */
   if (!info->fixed_regs_live)
     {
-      info->failure =  true;
+      info->failure = true;
       return;
     }
   /* Now check if this is a live fixed register.  */
-  r = REGNO (loc);
-  n = hard_regno_nregs[r][GET_MODE (loc)];
-  while (--n >=  0)
-    if (REGNO_REG_SET_P (info->fixed_regs_live, r+n))
-      info->failure =  true;
+  unsigned int end_regno = END_REGNO (loc);
+  for (unsigned int regno = REGNO (loc); regno < end_regno; ++regno)
+    if (REGNO_REG_SET_P (info->fixed_regs_live, regno))
+      info->failure = true;
 }
 
 /* Callback for for_each_inc_dec that emits an INSN that sets DEST to
@@ -907,7 +863,7 @@ emit_inc_dec_insn_before (rtx mem ATTRIBUTE_UNUSED,
       end_sequence ();
     }
   else
-    new_insn = as_a <rtx_insn *> (gen_move_insn (dest, src));
+    new_insn = gen_move_insn (dest, src);
   info.first = new_insn;
   info.fixed_regs_live = insn_info->fixed_regs_live;
   info.failure = false;
@@ -950,7 +906,7 @@ check_for_inc_dec_1 (insn_info_t insn_info)
 bool
 check_for_inc_dec (rtx_insn *insn)
 {
-  struct insn_info insn_info;
+  insn_info_type insn_info;
   rtx note;
 
   insn_info.insn = insn;
@@ -991,7 +947,7 @@ delete_dead_store_insn (insn_info_t insn_info)
   while (read_info)
     {
       read_info_t next = read_info->next;
-      pool_free (read_info_pool, read_info);
+      read_info_type_pool.remove (read_info);
       read_info = next;
     }
   insn_info->read_rec = NULL;
@@ -1049,7 +1005,7 @@ can_escape (tree expr)
    OFFSET and WIDTH.  */
 
 static void
-set_usage_bits (group_info_t group, HOST_WIDE_INT offset, HOST_WIDE_INT width,
+set_usage_bits (group_info *group, HOST_WIDE_INT offset, HOST_WIDE_INT width,
                 tree expr)
 {
   HOST_WIDE_INT i;
@@ -1115,7 +1071,7 @@ free_read_records (bb_info_t bb_info)
       read_info_t next = (*ptr)->next;
       if ((*ptr)->alias_set == 0)
         {
-          pool_free (read_info_pool, *ptr);
+         read_info_type_pool.remove (*ptr);
           *ptr = next;
         }
       else
@@ -1169,7 +1125,7 @@ const_or_frame_p (rtx x)
        return true;
       return false;
     }
-  
+
   return false;
 }
 
@@ -1274,7 +1230,7 @@ canon_address (rtx mem,
       if (ADDR_SPACE_GENERIC_P (MEM_ADDR_SPACE (mem))
          && const_or_frame_p (address))
        {
-         group_info_t group = get_group_info (address);
+         group_info *group = get_group_info (address);
 
          if (dump_file && (dump_flags & TDF_DETAILS))
            fprintf (dump_file, "  gid=%d offset=%d \n",
@@ -1310,7 +1266,7 @@ clear_rhs_from_active_local_stores (void)
 
   while (ptr)
     {
-      store_info_t store_info = ptr->store_rec;
+      store_info *store_info = ptr->store_rec;
       /* Skip the clobbers.  */
       while (!store_info->is_set)
        store_info = store_info->next;
@@ -1326,7 +1282,7 @@ clear_rhs_from_active_local_stores (void)
 /* Mark byte POS bytes from the beginning of store S_INFO as unneeded.  */
 
 static inline void
-set_position_unneeded (store_info_t s_info, int pos)
+set_position_unneeded (store_info *s_info, int pos)
 {
   if (__builtin_expect (s_info->is_large, false))
     {
@@ -1341,7 +1297,7 @@ set_position_unneeded (store_info_t s_info, int pos)
 /* Mark the whole store S_INFO as unneeded.  */
 
 static inline void
-set_all_positions_unneeded (store_info_t s_info)
+set_all_positions_unneeded (store_info *s_info)
 {
   if (__builtin_expect (s_info->is_large, false))
     {
@@ -1357,7 +1313,7 @@ set_all_positions_unneeded (store_info_t s_info)
 /* Return TRUE if any bytes from S_INFO store are needed.  */
 
 static inline bool
-any_positions_needed_p (store_info_t s_info)
+any_positions_needed_p (store_info *s_info)
 {
   if (__builtin_expect (s_info->is_large, false))
     return (s_info->positions_needed.large.count
@@ -1371,7 +1327,7 @@ any_positions_needed_p (store_info_t s_info)
    store are needed.  */
 
 static inline bool
-all_positions_needed_p (store_info_t s_info, int start, int width)
+all_positions_needed_p (store_info *s_info, int start, int width)
 {
   if (__builtin_expect (s_info->is_large, false))
     {
@@ -1389,7 +1345,7 @@ all_positions_needed_p (store_info_t s_info, int start, int width)
 }
 
 
-static rtx get_stored_val (store_info_t, machine_mode, HOST_WIDE_INT,
+static rtx get_stored_val (store_info *, machine_mode, HOST_WIDE_INT,
                           HOST_WIDE_INT, basic_block, bool);
 
 
@@ -1405,7 +1361,7 @@ record_store (rtx body, bb_info_t bb_info)
   HOST_WIDE_INT width = 0;
   alias_set_type spill_alias_set;
   insn_info_t insn_info = bb_info->last_insn;
-  store_info_t store_info = NULL;
+  store_info *store_info = NULL;
   int group_id;
   cselib_val *base = NULL;
   insn_info_t ptr, last, redundant_reason;
@@ -1490,7 +1446,7 @@ record_store (rtx body, bb_info_t bb_info)
       if (clear_alias_group->offset_map_size_p < spill_alias_set)
        clear_alias_group->offset_map_size_p = spill_alias_set;
 
-      store_info = (store_info_t) pool_alloc (rtx_store_info_pool);
+      store_info = rtx_store_info_pool.allocate ();
 
       if (dump_file && (dump_flags & TDF_DETAILS))
        fprintf (dump_file, " processing spill store %d(%s)\n",
@@ -1501,11 +1457,11 @@ record_store (rtx body, bb_info_t bb_info)
       /* In the restrictive case where the base is a constant or the
         frame pointer we can do global analysis.  */
 
-      group_info_t group
+      group_info *group
        = rtx_group_vec[group_id];
       tree expr = MEM_EXPR (mem);
 
-      store_info = (store_info_t) pool_alloc (rtx_store_info_pool);
+      store_info = rtx_store_info_pool.allocate ();
       set_usage_bits (group, offset, width, expr);
 
       if (dump_file && (dump_flags & TDF_DETAILS))
@@ -1518,7 +1474,7 @@ record_store (rtx body, bb_info_t bb_info)
        insn_info->stack_pointer_based = true;
       insn_info->contains_cselib_groups = true;
 
-      store_info = (store_info_t) pool_alloc (cse_store_info_pool);
+      store_info = cse_store_info_pool.allocate ();
       group_id = -1;
 
       if (dump_file && (dump_flags & TDF_DETAILS))
@@ -1571,7 +1527,7 @@ record_store (rtx body, bb_info_t bb_info)
        mem_addr = base->val_rtx;
       else
        {
-         group_info_t group
+         group_info *group
            = rtx_group_vec[group_id];
          mem_addr = group->canon_base_addr;
        }
@@ -1586,7 +1542,7 @@ record_store (rtx body, bb_info_t bb_info)
   while (ptr)
     {
       insn_info_t next = ptr->next_local_store;
-      store_info_t s_info = ptr->store_rec;
+      struct store_info *s_info = ptr->store_rec;
       bool del = true;
 
       /* Skip the clobbers. We delete the active insn if this insn
@@ -1756,7 +1712,7 @@ dump_insn_info (const char * start, insn_info_t insn_info)
 
 static rtx
 find_shift_sequence (int access_size,
-                    store_info_t store_info,
+                    store_info *store_info,
                     machine_mode read_mode,
                     int shift, bool speed, bool require_cst)
 {
@@ -1797,7 +1753,8 @@ find_shift_sequence (int access_size,
                  byte = subreg_lowpart_offset (read_mode, new_mode);
                  ret = simplify_subreg (read_mode, ret, new_mode, byte);
                  if (ret && CONSTANT_P (ret)
-                     && set_src_cost (ret, speed) <= COSTS_N_INSNS (1))
+                     && (set_src_cost (ret, read_mode, speed)
+                         <= COSTS_N_INSNS (1)))
                    return ret;
                }
            }
@@ -1878,11 +1835,7 @@ look_for_hardregs (rtx x, const_rtx pat ATTRIBUTE_UNUSED, void *data)
 
   if (REG_P (x)
       && HARD_REGISTER_P (x))
-    {
-      unsigned int regno = REGNO (x);
-      bitmap_set_range (regs_set, regno,
-                       hard_regno_nregs[regno][GET_MODE (x)]);
-    }
+    bitmap_set_range (regs_set, REGNO (x), REG_NREGS (x));
 }
 
 /* Helper function for replace_read and record_store.
@@ -1891,7 +1844,7 @@ look_for_hardregs (rtx x, const_rtx pat ATTRIBUTE_UNUSED, void *data)
    if not successful.  If REQUIRE_CST is true, return always constant.  */
 
 static rtx
-get_stored_val (store_info_t store_info, machine_mode read_mode,
+get_stored_val (store_info *store_info, machine_mode read_mode,
                HOST_WIDE_INT read_begin, HOST_WIDE_INT read_end,
                basic_block bb, bool require_cst)
 {
@@ -1991,7 +1944,7 @@ get_stored_val (store_info_t store_info, machine_mode read_mode,
    went ok.  */
 
 static bool
-replace_read (store_info_t store_info, insn_info_t store_insn,
+replace_read (store_info *store_info, insn_info_t store_insn,
              read_info_t read_info, insn_info_t read_insn, rtx *loc,
              bitmap regs_live)
 {
@@ -2066,8 +2019,7 @@ replace_read (store_info_t store_info, insn_info_t store_insn,
 
   if (validate_change (read_insn->insn, loc, read_reg, 0))
     {
-      deferred_change_t deferred_change =
-       (deferred_change_t) pool_alloc (deferred_change_pool);
+      deferred_change *change = deferred_change_pool.allocate ();
 
       /* Insert this right before the store insn where it will be safe
         from later insns that might change it before the read.  */
@@ -2097,15 +2049,15 @@ replace_read (store_info_t store_info, insn_info_t store_insn,
         block we can put them back.  */
 
       *loc = read_info->mem;
-      deferred_change->next = deferred_change_list;
-      deferred_change_list = deferred_change;
-      deferred_change->loc = loc;
-      deferred_change->reg = read_reg;
+      change->next = deferred_change_list;
+      deferred_change_list = change;
+      change->loc = loc;
+      change->reg = read_reg;
 
       /* Get rid of the read_info, from the point of view of the
         rest of dse, play like this read never happened.  */
       read_insn->read_rec = read_info->next;
-      pool_free (read_info_pool, read_info);
+      read_info_type_pool.remove (read_info);
       if (dump_file && (dump_flags & TDF_DETAILS))
        {
          fprintf (dump_file, " -- replaced the loaded MEM with ");
@@ -2171,7 +2123,7 @@ check_mem_read_rtx (rtx *loc, bb_info_t bb_info)
   else
     width = GET_MODE_SIZE (GET_MODE (mem));
 
-  read_info = (read_info_t) pool_alloc (read_info_pool);
+  read_info = read_info_type_pool.allocate ();
   read_info->group_id = group_id;
   read_info->mem = mem;
   read_info->alias_set = spill_alias_set;
@@ -2188,7 +2140,7 @@ check_mem_read_rtx (rtx *loc, bb_info_t bb_info)
        mem_addr = base->val_rtx;
       else
        {
-         group_info_t group
+         group_info *group
            = rtx_group_vec[group_id];
          mem_addr = group->canon_base_addr;
        }
@@ -2214,7 +2166,7 @@ check_mem_read_rtx (rtx *loc, bb_info_t bb_info)
 
       while (i_ptr)
        {
-         store_info_t store_info = i_ptr->store_rec;
+         store_info *store_info = i_ptr->store_rec;
 
          /* Skip the clobbers.  */
          while (!store_info->is_set)
@@ -2256,7 +2208,7 @@ check_mem_read_rtx (rtx *loc, bb_info_t bb_info)
       while (i_ptr)
        {
          bool remove = false;
-         store_info_t store_info = i_ptr->store_rec;
+         store_info *store_info = i_ptr->store_rec;
 
          /* Skip the clobbers.  */
          while (!store_info->is_set)
@@ -2340,7 +2292,7 @@ check_mem_read_rtx (rtx *loc, bb_info_t bb_info)
       while (i_ptr)
        {
          bool remove = false;
-         store_info_t store_info = i_ptr->store_rec;
+         store_info *store_info = i_ptr->store_rec;
 
          if (dump_file && (dump_flags & TDF_DETAILS))
            fprintf (dump_file, " processing cselib load against insn %d\n",
@@ -2487,9 +2439,9 @@ static void
 scan_insn (bb_info_t bb_info, rtx_insn *insn)
 {
   rtx body;
-  insn_info_t insn_info = (insn_info_t) pool_alloc (insn_info_pool);
+  insn_info_type *insn_info = insn_info_type_pool.allocate ();
   int mems_found = 0;
-  memset (insn_info, 0, sizeof (struct insn_info));
+  memset (insn_info, 0, sizeof (struct insn_info_type));
 
   if (dump_file && (dump_flags & TDF_DETAILS))
     fprintf (dump_file, "\n**scanning insn=%d\n",
@@ -2570,7 +2522,7 @@ scan_insn (bb_info_t bb_info, rtx_insn *insn)
              /* If the frame is read, the frame related stores are killed.  */
              else if (insn_info->frame_read)
                {
-                 store_info_t store_info = i_ptr->store_rec;
+                 store_info *store_info = i_ptr->store_rec;
 
                  /* Skip the clobbers.  */
                  while (!store_info->is_set)
@@ -2608,7 +2560,7 @@ scan_insn (bb_info_t bb_info, rtx_insn *insn)
                {
                  rtx mem = gen_rtx_MEM (BLKmode, args[0]);
                  set_mem_size (mem, INTVAL (args[2]));
-                 body = gen_rtx_SET (VOIDmode, mem, args[1]);
+                 body = gen_rtx_SET (mem, args[1]);
                  mems_found += record_store (body, bb_info);
                  if (dump_file && (dump_flags & TDF_DETAILS))
                    fprintf (dump_file, "handling memset as BLKmode store\n");
@@ -2697,7 +2649,7 @@ remove_useless_values (cselib_val *base)
 
   while (insn_info)
     {
-      store_info_t store_info = insn_info->store_rec;
+      store_info *store_info = insn_info->store_rec;
       bool del = false;
 
       /* If ANY of the store_infos match the cselib group that is
@@ -2746,9 +2698,9 @@ dse_step1 (void)
   FOR_ALL_BB_FN (bb, cfun)
     {
       insn_info_t ptr;
-      bb_info_t bb_info = (bb_info_t) pool_alloc (bb_info_pool);
+      bb_info_t bb_info = dse_bb_info_type_pool.allocate ();
 
-      memset (bb_info, 0, sizeof (struct dse_bb_info));
+      memset (bb_info, 0, sizeof (dse_bb_info_type));
       bitmap_set_bit (all_blocks, bb->index);
       bb_info->regs_live = regs_live;
 
@@ -2762,9 +2714,6 @@ dse_step1 (void)
        {
          rtx_insn *insn;
 
-         cse_store_info_pool
-           = create_alloc_pool ("cse_store_info_pool",
-                                sizeof (struct store_info), 100);
          active_local_stores = NULL;
          active_local_stores_len = 0;
          cselib_clear_table ();
@@ -2797,7 +2746,7 @@ dse_step1 (void)
              insn_info_t i_ptr = active_local_stores;
              while (i_ptr)
                {
-                 store_info_t store_info = i_ptr->store_rec;
+                 store_info *store_info = i_ptr->store_rec;
 
                  /* Skip the clobbers.  */
                  while (!store_info->is_set)
@@ -2807,7 +2756,7 @@ dse_step1 (void)
                  else
                    if (store_info->group_id >= 0)
                      {
-                       group_info_t group
+                       group_info *group
                          = rtx_group_vec[store_info->group_id];
                        if (group->frame_related && !i_ptr->cannot_delete)
                          delete_dead_store_insn (i_ptr);
@@ -2821,12 +2770,12 @@ dse_step1 (void)
             replace_read.  Cselib is finished with this block.  */
          while (deferred_change_list)
            {
-             deferred_change_t next = deferred_change_list->next;
+             deferred_change *next = deferred_change_list->next;
 
              /* There is no reason to validate this change.  That was
                 done earlier.  */
              *deferred_change_list->loc = deferred_change_list->reg;
-             pool_free (deferred_change_pool, deferred_change_list);
+             deferred_change_pool.remove (deferred_change_list);
              deferred_change_list = next;
            }
 
@@ -2838,7 +2787,7 @@ dse_step1 (void)
            {
              if (ptr->contains_cselib_groups)
                {
-                 store_info_t s_info = ptr->store_rec;
+                 store_info *s_info = ptr->store_rec;
                  while (s_info && !s_info->is_set)
                    s_info = s_info->next;
                  if (s_info
@@ -2859,7 +2808,7 @@ dse_step1 (void)
                }
              else
                {
-                 store_info_t s_info;
+                 store_info *s_info;
 
                  /* Free at least positions_needed bitmaps.  */
                  for (s_info = ptr->store_rec; s_info; s_info = s_info->next)
@@ -2872,7 +2821,7 @@ dse_step1 (void)
              ptr = ptr->prev_insn;
            }
 
-         free_alloc_pool (cse_store_info_pool);
+         cse_store_info_pool.release ();
        }
       bb_info->regs_live = NULL;
     }
@@ -2895,7 +2844,7 @@ static void
 dse_step2_init (void)
 {
   unsigned int i;
-  group_info_t group;
+  group_info *group;
 
   FOR_EACH_VEC_ELT (rtx_group_vec, i, group)
     {
@@ -2946,7 +2895,7 @@ static bool
 dse_step2_nospill (void)
 {
   unsigned int i;
-  group_info_t group;
+  group_info *group;
   /* Position 0 is unused because 0 is used in the maps to mean
      unused.  */
   current_position = 1;
@@ -2995,7 +2944,7 @@ dse_step2_nospill (void)
    there, return 0.  */
 
 static int
-get_bitmap_index (group_info_t group_info, HOST_WIDE_INT offset)
+get_bitmap_index (group_info *group_info, HOST_WIDE_INT offset)
 {
   if (offset < 0)
     {
@@ -3017,12 +2966,12 @@ get_bitmap_index (group_info_t group_info, HOST_WIDE_INT offset)
    may be NULL. */
 
 static void
-scan_stores_nospill (store_info_t store_info, bitmap gen, bitmap kill)
+scan_stores_nospill (store_info *store_info, bitmap gen, bitmap kill)
 {
   while (store_info)
     {
       HOST_WIDE_INT i;
-      group_info_t group_info
+      group_info *group_info
        = rtx_group_vec[store_info->group_id];
       if (group_info->process_globally)
        for (i = store_info->begin; i < store_info->end; i++)
@@ -3044,7 +2993,7 @@ scan_stores_nospill (store_info_t store_info, bitmap gen, bitmap kill)
    may be NULL. */
 
 static void
-scan_stores_spill (store_info_t store_info, bitmap gen, bitmap kill)
+scan_stores_spill (store_info *store_info, bitmap gen, bitmap kill)
 {
   while (store_info)
     {
@@ -3072,7 +3021,7 @@ scan_reads_nospill (insn_info_t insn_info, bitmap gen, bitmap kill)
 {
   read_info_t read_info = insn_info->read_rec;
   int i;
-  group_info_t group;
+  group_info *group;
 
   /* If this insn reads the frame, kill all the frame related stores.  */
   if (insn_info->frame_read)
@@ -3280,7 +3229,7 @@ dse_step3_exit_block_scan (bb_info_t bb_info)
   if (stores_off_frame_dead_at_return)
     {
       unsigned int i;
-      group_info_t group;
+      group_info *group;
 
       FOR_EACH_VEC_ELT (rtx_group_vec, i, group)
        {
@@ -3361,7 +3310,7 @@ dse_step3 (bool for_spills)
          if (!all_ones)
            {
              unsigned int j;
-             group_info_t group;
+             group_info *group;
 
              all_ones = BITMAP_ALLOC (&dse_bitmap_obstack);
              FOR_EACH_VEC_ELT (rtx_group_vec, j, group)
@@ -3565,7 +3514,7 @@ dse_step5_nospill (void)
              && (!insn_info->cannot_delete)
              && (!bitmap_empty_p (v)))
            {
-             store_info_t store_info = insn_info->store_rec;
+             store_info *store_info = insn_info->store_rec;
 
              /* Try to delete the current insn.  */
              deleted = true;
@@ -3579,7 +3528,7 @@ dse_step5_nospill (void)
              else
                {
                  HOST_WIDE_INT i;
-                 group_info_t group_info
+                 group_info *group_info
                    = rtx_group_vec[store_info->group_id];
 
                  for (i = store_info->begin; i < store_info->end; i++)
@@ -3665,7 +3614,7 @@ dse_step6 (void)
              && INSN_P (insn_info->insn)
              && !insn_info->cannot_delete)
            {
-             store_info_t s_info = insn_info->store_rec;
+             store_info *s_info = insn_info->store_rec;
 
              while (s_info && !s_info->is_set)
                s_info = s_info->next;
@@ -3710,12 +3659,12 @@ dse_step7 (void)
   BITMAP_FREE (all_blocks);
   BITMAP_FREE (scratch);
 
-  free_alloc_pool (rtx_store_info_pool);
-  free_alloc_pool (read_info_pool);
-  free_alloc_pool (insn_info_pool);
-  free_alloc_pool (bb_info_pool);
-  free_alloc_pool (rtx_group_info_pool);
-  free_alloc_pool (deferred_change_pool);
+  rtx_store_info_pool.release ();
+  read_info_type_pool.release ();
+  insn_info_type_pool.release ();
+  dse_bb_info_type_pool.release ();
+  group_info_pool.release ();
+  deferred_change_pool.release ();
 }