diff mbox

[5/5] workaround for PR70427

Message ID 1463848586-19259-6-git-send-email-andi@firstfloor.org
State New
Headers show

Commit Message

Andi Kleen May 21, 2016, 4:36 p.m. UTC
From: Andi Kleen <ak@linux.intel.com>

This makes autofdo bootstrap not crash.

This is probably not the right fix, but for now it works for me.
Not for submission.
---
 gcc/ipa-profile.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Jan Hubicka May 30, 2016, 12:34 a.m. UTC | #1
> From: Andi Kleen <ak@linux.intel.com>
> 
> This makes autofdo bootstrap not crash.
> 
> This is probably not the right fix, but for now it works for me.
> Not for submission.
> ---
>  gcc/ipa-profile.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/gcc/ipa-profile.c b/gcc/ipa-profile.c
> index da17bcd..c7d7792 100644
> --- a/gcc/ipa-profile.c
> +++ b/gcc/ipa-profile.c
> @@ -201,6 +201,8 @@ ipa_profile_generate_summary (void)
>  		    if (h->hvalue.counters[2])
>  		      {
>  			struct cgraph_edge * e = node->get_edge (stmt);
> +			if (!e)
> +			  continue;

This is odd. I do not think auto-fdo produces indirect call histograms and the
edges should be present here.  Do you know from where the histogram is created?

Honza
>  			if (e && !e->indirect_unknown_callee)
>  			  continue;
>  			e->indirect_info->common_target_id
> -- 
> 2.8.2
Andi Kleen May 30, 2016, 3:12 a.m. UTC | #2
On Mon, May 30, 2016 at 02:34:03AM +0200, Jan Hubicka wrote:
> > diff --git a/gcc/ipa-profile.c b/gcc/ipa-profile.c
> > index da17bcd..c7d7792 100644
> > --- a/gcc/ipa-profile.c
> > +++ b/gcc/ipa-profile.c
> > @@ -201,6 +201,8 @@ ipa_profile_generate_summary (void)
> >  		    if (h->hvalue.counters[2])
> >  		      {
> >  			struct cgraph_edge * e = node->get_edge (stmt);
> > +			if (!e)
> > +			  continue;
> 
> This is odd. I do not think auto-fdo produces indirect call histograms and the
> edges should be present here.  Do you know from where the histogram is created?

I don't know. How would I find out?

It should be reproducible by applying the patchkit and running make autoprofiledbootstrap

-Andi
diff mbox

Patch

diff --git a/gcc/ipa-profile.c b/gcc/ipa-profile.c
index da17bcd..c7d7792 100644
--- a/gcc/ipa-profile.c
+++ b/gcc/ipa-profile.c
@@ -201,6 +201,8 @@  ipa_profile_generate_summary (void)
 		    if (h->hvalue.counters[2])
 		      {
 			struct cgraph_edge * e = node->get_edge (stmt);
+			if (!e)
+			  continue;
 			if (e && !e->indirect_unknown_callee)
 			  continue;
 			e->indirect_info->common_target_id