OSDN Git Service

* gcc.c-torture/execute/ieee/ieee.exp: Change sh-*-* to sh*-*-*.
[pf3gnuchains/gcc-fork.git] / gcc / predict.c
index df69e94..4c32ac0 100644 (file)
@@ -69,10 +69,10 @@ static void counts_to_freqs          PARAMS ((void));
    Filled using information from predict.def.  */
 struct predictor_info
 {
-  const char *name;    /* Name used in the debugging dumps.  */
-  int hitrate;         /* Expected hitrate used by
-                          predict_insn_def call.  */
-  int flags;
+  const char *const name;      /* Name used in the debugging dumps.  */
+  const int hitrate;           /* Expected hitrate used by
+                                  predict_insn_def call.  */
+  const int flags;
 };
 
 /* Use given predictor without Dempster-Shaffer theory if it matches
@@ -84,7 +84,7 @@ struct predictor_info
 #define HITRATE(VAL) ((int)((VAL) * REG_BR_PROB_BASE + 50) / 100)
 
 #define DEF_PREDICTOR(ENUM, NAME, HITRATE, FLAGS) {NAME, HITRATE, FLAGS},
-struct predictor_info predictor_info[] = {
+static const struct predictor_info predictor_info[] = {
 #include "predict.def"
 
   /* Upper bound on predictors.  */
@@ -573,7 +573,7 @@ expected_value_to_br_prob ()
         as canonicalize_condition will render this to us as
                (lt r70, r71)
         Could use cselib to try and reduce this further.  */
-      cond = XEXP (SET_SRC (PATTERN (insn)), 0);
+      cond = XEXP (SET_SRC (pc_set (insn)), 0);
       cond = canonicalize_condition (insn, cond, 0, NULL, ev_reg);
       if (! cond
          || XEXP (cond, 0) != ev_reg
@@ -832,9 +832,6 @@ static void
 estimate_bb_frequencies (loops)
      struct loops *loops;
 {
-  block_info bi;
-  edge_info ei;
-  int edgenum = 0;
   int i;
   double freq_max = 0;
 
@@ -891,8 +888,8 @@ estimate_bb_frequencies (loops)
   ENTRY_BLOCK_PTR->succ->probability = REG_BR_PROB_BASE;
 
   /* Set up block info for each basic block.  */
-  bi = (block_info) xcalloc ((n_basic_blocks + 2), sizeof (*bi));
-  ei = (edge_info) xcalloc ((n_edges), sizeof (*ei));
+  alloc_aux_for_blocks (sizeof (struct block_info_def));
+  alloc_aux_for_edges (sizeof (struct edge_info_def));
   for (i = -2; i < n_basic_blocks; i++)
     {
       edge e;
@@ -904,14 +901,10 @@ estimate_bb_frequencies (loops)
        bb = EXIT_BLOCK_PTR;
       else
        bb = BASIC_BLOCK (i);
-      bb->aux = bi + i + 2;
       BLOCK_INFO (bb)->tovisit = 0;
       for (e = bb->succ; e; e = e->succ_next)
-       {
-         e->aux = ei + edgenum, edgenum++;
-         EDGE_INFO (e)->back_edge_prob = ((double) e->probability
-                                          / REG_BR_PROB_BASE);
-       }
+       EDGE_INFO (e)->back_edge_prob = ((double) e->probability
+                                        / REG_BR_PROB_BASE);
     }
   /* First compute probabilities locally for each loop from innermost
      to outermost to examine probabilities for back edges.  */
@@ -940,6 +933,6 @@ estimate_bb_frequencies (loops)
                       + 0.5);
     }
 
-  free (ei);
-  free (bi);
+  free_aux_for_blocks ();
+  free_aux_for_edges ();
 }