There appears to be a bug in value-prof.c:visit_hist rev 121554. This function always returns 0, which causes htab_traverse to exit early. This means that only the first histogram that appears in cfun- >value_histograms->entries is ever checked, so verify_histograms will only indicate an error if the first histogram is unreachable. The attached patch changes the return value to ensure that all histograms are checked. This patch bootstraps and passes make check on x86_64.

Robert Kidd
[EMAIL PROTECTED]

Index: gcc/value-prof.c
===================================================================
--- gcc/value-prof.c    (revision 121671)
+++ gcc/value-prof.c    (working copy)
@@ -353,8 +353,9 @@ visit_hist (void **slot, void *data)
       dump_histogram_value (stderr, hist);
       debug_generic_stmt (hist->hvalue.stmt);
       error_found = true;
+      return 0;
     }
-  return 0;
+  return 1;
 }
 
 /* Verify sanity of the histograms.  */

Reply via email to