OSDN Git Service

PR middle-end/48641
[pf3gnuchains/gcc-fork.git] / gcc / tree-ssa-threadupdate.c
index 0cdf846..6000a03 100644 (file)
@@ -513,7 +513,11 @@ redirect_edges (void **slot, void *data)
                     e->src->index, e->dest->index, rd->dup_block->index);
 
          rd->dup_block->count += e->count;
-         rd->dup_block->frequency += EDGE_FREQUENCY (e);
+
+         /* Excessive jump threading may make frequencies large enough so
+            the computation overflows.  */
+         if (rd->dup_block->frequency < BB_FREQ_MAX * 2)
+           rd->dup_block->frequency += EDGE_FREQUENCY (e);
          EDGE_SUCC (rd->dup_block, 0)->count += e->count;
          /* Redirect the incoming edge to the appropriate duplicate
             block.  */