]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* analyze_brprob: Avoid overflows.
authorJan Hubicka <jh@suse.cz>
Fri, 27 Jul 2001 16:03:08 +0000 (18:03 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Fri, 27 Jul 2001 16:03:08 +0000 (16:03 +0000)
From-SVN: r44430

contrib/ChangeLog
contrib/analyze_brprob

index f9d48b116eca41bac893bdf6b7c896eb09bbba0d..4284410b0c73cfd04d7f92cf4b22334799d50491 100644 (file)
@@ -1,3 +1,7 @@
+Fri Jul 27 18:01:21 CEST 2001  Jan Hubicka  <jh@suse.cz>
+
+       * analyze_brprob: Avoid overflows.
+
 2001-07-27  Richard Henderson  <rth@redhat.com>
 
        * gcc_update: Dump timestamp in LAST_UPDATED.
index c385d847b5663e41064b736e3899a48794730de3..3c7e8e5712db5b8ec0ac0a9bb6c1fb1608829e2a 100755 (executable)
@@ -116,17 +116,17 @@ BEGIN {nnames = 0}
       }
     counts[name]=counts[name] "+" count
     hits[name]=hits[name] "+" hit
-    if (int (hit) < (int (count) / 2))
-      hit = count - hit;
+    if (float (hit) < (float (count) / 2))
+      hit = "("count" - "hit")";
     phits[name]=phits[name] "+" hit
 
     #BC crashes on long strings.  Irritating.
-    if (length(counts[name]) > 4000)
-      {
-       counts[name] = longeval(counts[name])
-       hits[name] = longeval(hits[name])
-       phits[name] = longeval(phits[name])
-      }
+    if (length(counts[name]) > 2000)
+      counts[name] = longeval(counts[name])
+    if (length(hits[name]) > 2000)
+      hits[name] = longeval(hits[name])
+    if (length(phits[name]) > 2000)
+      phits[name] = longeval(phits[name])
   }
 END {
   # Heuristics called combined predicts just everything.