This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Patch to add an error message when the profile is corrupted


I filed a bug report here:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47363

which describes the issue. There is an incorrect error message printed
when the profile is corrupted in the case where *count > *all. This
error message may be confusing to the user. I have a patch here that
prints a more appropriate error message in the case where *count >
*all.

I can amend the error message if you want me to.

gcc/ChangeLog
2011-01-19 Ahmad Sharif <asharif@google.com>

	PR gcov-profile/47363
	* gcc/value-prof.c (check_counter): Added an error message for the case
	where *count > *all.

Index: gcc/value-prof.c
===================================================================
--- gcc/value-prof.c	(revision 169016)
+++ gcc/value-prof.c	(working copy)
@@ -473,9 +473,15 @@
 	}
       else
 	{
-	  error_at (locus, "corrupted value profile: %s "
-		    "profiler overall count (%d) does not match BB count (%d)",
-		    name, (int)*all, (int)bb_count);
+          if (*all != bb_count)
+	    error_at (locus, "corrupted value profile: %s "
+		      "profiler overall count (%d) does not match BB count (%d)",
+		      name, (int)*all, (int)bb_count);
+          if (*count > *all)
+            error_at (locus, "corrupted value profile: %s "
+                      "profiler count (%d) greater than "
+                      "profiler overall count (%d)",
+                      name, (int)*count, (int)*all);
 	  return true;
 	}
     }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]