Patchwork Patch to add an error message when the profile is corrupted

login
register
mail settings
Submitter asharif tools
Date Jan. 24, 2011, 9:21 p.m.
Message ID <AANLkTimUeuwAGrdH_=fXm-D7hi0O6mhW5BN2aw4KmOKj@mail.gmail.com>
Download mbox | patch
Permalink /patch/80255/
State New
Headers show

Comments

asharif tools - Jan. 24, 2011, 9:21 p.m.
On Mon, Jan 24, 2011 at 1:19 PM, asharif tools <asharif.tools@gmail.com> wrote:
> On Fri, Jan 21, 2011 at 1:42 AM, Richard Guenther <rguenther@suse.de> wrote:
>>
>> It would be nice to improve the message to something that is more helpful
>> for the user.
>
> Richard, I replaced the error message with the one you posted on the bug:
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47363
>
> I also updated the bug with this patch.
>
> Thoughts?

Sorry about the double email -- I forgot a space in the patch. This is
the correct one:
Richard Guenther - Jan. 25, 2011, 10:13 a.m.
On Mon, 24 Jan 2011, asharif tools wrote:

> On Mon, Jan 24, 2011 at 1:19 PM, asharif tools <asharif.tools@gmail.com> wrote:
> > On Fri, Jan 21, 2011 at 1:42 AM, Richard Guenther <rguenther@suse.de> wrote:
> >>
> >> It would be nice to improve the message to something that is more helpful
> >> for the user.
> >
> > Richard, I replaced the error message with the one you posted on the bug:
> >
> > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47363
> >
> > I also updated the bug with this patch.
> >
> > Thoughts?
> 
> Sorry about the double email -- I forgot a space in the patch. This is
> the correct one:

This is ok with a proper change-log entry if it bootstraps and tests ok.

Thanks,
Richard.

> Index: gcc/value-prof.c
> ===================================================================
> --- gcc/value-prof.c	(revision 169016)
> +++ gcc/value-prof.c	(working copy)
> @@ -473,9 +473,12 @@
>  	}
>        else
>  	{
> -	  error_at (locus, "corrupted value profile: %s "
> -		    "profiler overall count (%d) does not match BB count (%d)",
> -		    name, (int)*all, (int)bb_count);
> +          error_at (locus, "profile counter (%d out of %d) inconsistent with "
> +                           "basic-block count (%d)",
> +                           name,
> +                           (int) *count,
> +                           (int) *all,
> +                           (int) bb_count);
>  	  return true;
>  	}
>      }
> 
>

Patch

Index: gcc/value-prof.c
===================================================================
--- gcc/value-prof.c	(revision 169016)
+++ gcc/value-prof.c	(working copy)
@@ -473,9 +473,12 @@ 
 	}
       else
 	{
-	  error_at (locus, "corrupted value profile: %s "
-		    "profiler overall count (%d) does not match BB count (%d)",
-		    name, (int)*all, (int)bb_count);
+          error_at (locus, "profile counter (%d out of %d) inconsistent with "
+                           "basic-block count (%d)",
+                           name,
+                           (int) *count,
+                           (int) *all,
+                           (int) bb_count);
 	  return true;
 	}
     }