Makefile.in (targ): Fix target name check.
[gcc.git] / gcc / store-motion.c
index 1cda4045b7ccad55fe298cac317731dc560700ae..6fc072c38e664d9d08e83e8f86a4170c3fbcf1bd 100644 (file)
@@ -1,6 +1,5 @@
 /* Store motion via Lazy Code Motion on the reverse CFG.
-   Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-   2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 1997-2013 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -54,7 +53,7 @@ along with GCC; see the file COPYING3.  If not see
      invalidate REG_EQUAL/REG_EQUIV notes for?).
    - pattern_regs in st_expr should be a regset (on its own obstack).
    - antic_stores and avail_stores should be VECs instead of lists.
-   - store_motion_mems should be a VEC instead of a list.
+   - store_motion_mems should be a vec instead of a list.
    - there should be an alloc pool for struct st_expr objects.
    - investigate whether it is helpful to make the address of an st_expr
      a cselib VALUE.
@@ -796,7 +795,7 @@ insert_store (struct st_expr * expr, edge e)
        int index = EDGE_INDEX (edge_list, tmp->src, tmp->dest);
 
        gcc_assert (index != EDGE_INDEX_NO_EDGE);
-       if (! TEST_BIT (st_insert_map[index], expr->index))
+       if (! bitmap_bit_p (st_insert_map[index], expr->index))
          break;
       }
 
@@ -807,7 +806,7 @@ insert_store (struct st_expr * expr, edge e)
       FOR_EACH_EDGE (tmp, ei, e->dest->preds)
        {
          int index = EDGE_INDEX (edge_list, tmp->src, tmp->dest);
-         RESET_BIT (st_insert_map[index], expr->index);
+         bitmap_clear_bit (st_insert_map[index], expr->index);
        }
       insert_insn_start_basic_block (insn, bb);
       return 0;
@@ -849,7 +848,7 @@ remove_reachable_equiv_notes (basic_block bb, struct st_expr *smexpr)
   sp = 0;
   ei = ei_start (bb->succs);
 
-  sbitmap_zero (visited);
+  bitmap_clear (visited);
 
   act = (EDGE_COUNT (ei_container (ei)) > 0 ? EDGE_I (ei_container (ei), 0) : NULL);
   while (1)
@@ -867,16 +866,16 @@ remove_reachable_equiv_notes (basic_block bb, struct st_expr *smexpr)
       bb = act->dest;
 
       if (bb == EXIT_BLOCK_PTR
-         || TEST_BIT (visited, bb->index))
+         || bitmap_bit_p (visited, bb->index))
        {
          if (!ei_end_p (ei))
              ei_next (&ei);
          act = (! ei_end_p (ei)) ? ei_edge (ei) : NULL;
          continue;
        }
-      SET_BIT (visited, bb->index);
+      bitmap_set_bit (visited, bb->index);
 
-      if (TEST_BIT (st_antloc[bb->index], smexpr->index))
+      if (bitmap_bit_p (st_antloc[bb->index], smexpr->index))
        {
          for (last = smexpr->antic_stores;
               BLOCK_FOR_INSN (XEXP (last, 0)) != bb;
@@ -1014,10 +1013,10 @@ build_store_vectors (void)
   /* Build the gen_vector. This is any store in the table which is not killed
      by aliasing later in its block.  */
   st_avloc = sbitmap_vector_alloc (last_basic_block, num_stores);
-  sbitmap_vector_zero (st_avloc, last_basic_block);
+  bitmap_vector_clear (st_avloc, last_basic_block);
 
   st_antloc = sbitmap_vector_alloc (last_basic_block, num_stores);
-  sbitmap_vector_zero (st_antloc, last_basic_block);
+  bitmap_vector_clear (st_antloc, last_basic_block);
 
   for (ptr = first_st_expr (); ptr != NULL; ptr = next_st_expr (ptr))
     {
@@ -1030,7 +1029,7 @@ build_store_vectors (void)
             we can delete this one (It occurs earlier in the block). We'll
             copy the SRC expression to an unused register in case there
             are any side effects.  */
-         if (TEST_BIT (st_avloc[bb->index], ptr->index))
+         if (bitmap_bit_p (st_avloc[bb->index], ptr->index))
            {
              rtx r = gen_reg_rtx_and_attrs (ptr->pattern);
              if (dump_file)
@@ -1038,22 +1037,22 @@ build_store_vectors (void)
              replace_store_insn (r, XEXP (st, 0), bb, ptr);
              continue;
            }
-         SET_BIT (st_avloc[bb->index], ptr->index);
+         bitmap_set_bit (st_avloc[bb->index], ptr->index);
        }
 
       for (st = ptr->antic_stores; st != NULL; st = XEXP (st, 1))
        {
          insn = XEXP (st, 0);
          bb = BLOCK_FOR_INSN (insn);
-         SET_BIT (st_antloc[bb->index], ptr->index);
+         bitmap_set_bit (st_antloc[bb->index], ptr->index);
        }
     }
 
   st_kill = sbitmap_vector_alloc (last_basic_block, num_stores);
-  sbitmap_vector_zero (st_kill, last_basic_block);
+  bitmap_vector_clear (st_kill, last_basic_block);
 
   st_transp = sbitmap_vector_alloc (last_basic_block, num_stores);
-  sbitmap_vector_zero (st_transp, last_basic_block);
+  bitmap_vector_clear (st_transp, last_basic_block);
   regs_set_in_block = XNEWVEC (int, max_gcse_regno);
 
   FOR_EACH_BB (bb)
@@ -1079,12 +1078,12 @@ build_store_vectors (void)
            {
              /* It should not be necessary to consider the expression
                 killed if it is both anticipatable and available.  */
-             if (!TEST_BIT (st_antloc[bb->index], ptr->index)
-                 || !TEST_BIT (st_avloc[bb->index], ptr->index))
-               SET_BIT (st_kill[bb->index], ptr->index);
+             if (!bitmap_bit_p (st_antloc[bb->index], ptr->index)
+                 || !bitmap_bit_p (st_avloc[bb->index], ptr->index))
+               bitmap_set_bit (st_kill[bb->index], ptr->index);
            }
          else
-           SET_BIT (st_transp[bb->index], ptr->index);
+           bitmap_set_bit (st_transp[bb->index], ptr->index);
        }
     }
 
@@ -1092,10 +1091,10 @@ build_store_vectors (void)
 
   if (dump_file)
     {
-      dump_sbitmap_vector (dump_file, "st_antloc", "", st_antloc, last_basic_block);
-      dump_sbitmap_vector (dump_file, "st_kill", "", st_kill, last_basic_block);
-      dump_sbitmap_vector (dump_file, "st_transp", "", st_transp, last_basic_block);
-      dump_sbitmap_vector (dump_file, "st_avloc", "", st_avloc, last_basic_block);
+      dump_bitmap_vector (dump_file, "st_antloc", "", st_antloc, last_basic_block);
+      dump_bitmap_vector (dump_file, "st_kill", "", st_kill, last_basic_block);
+      dump_bitmap_vector (dump_file, "st_transp", "", st_transp, last_basic_block);
+      dump_bitmap_vector (dump_file, "st_avloc", "", st_avloc, last_basic_block);
     }
 }
 
@@ -1164,7 +1163,7 @@ one_store_motion_pass (void)
       /* If any of the edges we have above are abnormal, we can't move this
         store.  */
       for (x = NUM_EDGES (edge_list) - 1; x >= 0; x--)
-       if (TEST_BIT (st_insert_map[x], ptr->index)
+       if (bitmap_bit_p (st_insert_map[x], ptr->index)
            && (INDEX_EDGE (edge_list, x)->flags & EDGE_ABNORMAL))
          break;
 
@@ -1181,14 +1180,14 @@ one_store_motion_pass (void)
       /* Now we want to insert the new stores which are going to be needed.  */
 
       FOR_EACH_BB (bb)
-       if (TEST_BIT (st_delete_map[bb->index], ptr->index))
+       if (bitmap_bit_p (st_delete_map[bb->index], ptr->index))
          {
            delete_store (ptr, bb);
            n_stores_deleted++;
          }
 
       for (x = 0; x < NUM_EDGES (edge_list); x++)
-       if (TEST_BIT (st_insert_map[x], ptr->index))
+       if (bitmap_bit_p (st_insert_map[x], ptr->index))
          {
            did_edge_inserts |= insert_store (ptr, INDEX_EDGE (edge_list, x));
            n_stores_created++;
@@ -1238,6 +1237,7 @@ struct rtl_opt_pass pass_rtl_store_motion =
  {
   RTL_PASS,
   "store_motion",                       /* name */
+  OPTGROUP_NONE,                        /* optinfo_flags */
   gate_rtl_store_motion,                /* gate */
   execute_rtl_store_motion,            /* execute */
   NULL,                                 /* sub */
@@ -1249,6 +1249,6 @@ struct rtl_opt_pass pass_rtl_store_motion =
   0,                                    /* properties_destroyed */
   0,                                    /* todo_flags_start */
   TODO_df_finish | TODO_verify_rtl_sharing |
-  TODO_verify_flow | TODO_ggc_collect   /* todo_flags_finish */
+  TODO_verify_flow                      /* todo_flags_finish */
  }
 };