OSDN Git Service

* lib/old-dejagnu.exp (old-dejagnu): Copy extra source files
[pf3gnuchains/gcc-fork.git] / gcc / predict.c
index c5cc0a4..516cfbc 100644 (file)
@@ -556,7 +556,7 @@ expected_value_to_br_prob ()
          continue;
 
        case JUMP_INSN:
-         /* Look for simple conditional branches.  If we havn't got an
+         /* Look for simple conditional branches.  If we haven't got an
             expected value yet, no point going further.  */
          if (GET_CODE (insn) != JUMP_INSN || ev == NULL_RTX)
            continue;
@@ -602,7 +602,7 @@ expected_value_to_br_prob ()
 typedef struct block_info_def
 {
   /* Estimated frequency of execution of basic_block.  */
-  double frequency;
+  volatile double frequency;
 
   /* To keep queue of basic blocks to process.  */
   basic_block next;
@@ -611,7 +611,7 @@ typedef struct block_info_def
   int tovisit:1;
 
   /* Number of predecessors we need to visit first.  */
-  int npredecesors;
+  int npredecessors;
 } *block_info;
 
 /* Similar information for edges.  */
@@ -619,8 +619,11 @@ typedef struct edge_info_def
 {
   /* In case edge is an loopback edge, the probability edge will be reached
      in case header is.  Estimated number of iterations of the loop can be
-     then computed as 1 / (1 - back_edge_prob).  */
-  double back_edge_prob;
+     then computed as 1 / (1 - back_edge_prob).
+
+     Volatile is needed to avoid differences in the optimized and unoptimized
+     builds on machines where FP registers are wider than double.  */
+  volatile double back_edge_prob;
   /* True if the edge is an loopback edge in the natural loop.  */
   int back_edge:1;
 } *edge_info;
@@ -656,14 +659,14 @@ propagate_freq (head)
              fprintf (rtl_dump_file,
                       "Irreducible region hit, ignoring edge to %i->%i\n",
                       e->src->index, bb->index);
-         BLOCK_INFO (bb)->npredecesors = count;
+         BLOCK_INFO (bb)->npredecessors = count;
        }
     }
 
   BLOCK_INFO (head)->frequency = 1;
   for (; bb; bb = nextbb)
     {
-      double cyclic_probability = 0, frequency = 0;
+      volatile double cyclic_probability = 0, frequency = 0;
 
       nextbb = BLOCK_INFO (bb)->next;
       BLOCK_INFO (bb)->next = NULL;
@@ -703,10 +706,10 @@ propagate_freq (head)
       /* Propagate to successor blocks.  */
       for (e = bb->succ; e; e = e->succ_next)
        if (!(e->flags & EDGE_DFS_BACK)
-           && BLOCK_INFO (e->dest)->npredecesors)
+           && BLOCK_INFO (e->dest)->npredecessors)
          {
-           BLOCK_INFO (e->dest)->npredecesors--;
-           if (!BLOCK_INFO (e->dest)->npredecesors)
+           BLOCK_INFO (e->dest)->npredecessors--;
+           if (!BLOCK_INFO (e->dest)->npredecessors)
              {
                if (!nextbb)
                  nextbb = e->dest;