Re: [PATCH] Fix PR66705

2015-09-03 Thread Jan Hubicka
> > supplied by foreign code, so you need to be conservative anyway. > > I use all_refs_explicit_p () to go a conservative path. And indeed Yep, that should be safe. I guess you want two things 1) discover any possible ADDR_REF of a given symbol with all_refs_explicit_p. For that you want

Re: [PATCH] Fix PR66705

2015-09-02 Thread Richard Biener
On Wed, 2 Sep 2015, Jan Hubicka wrote: > > On Wed, 2 Sep 2015, Richard Biener wrote: > > > > > On Wed, 2 Sep 2015, Jan Hubicka wrote: > > > > > > > > > > > > > I was naiively using ->get_constructor in IPA PTA without proper > > > > > checking on wheter that succeeds. Now I tried to use ctor_f

Re: [PATCH] Fix PR66705

2015-09-02 Thread Jan Hubicka
> On Wed, 2 Sep 2015, Richard Biener wrote: > > > On Wed, 2 Sep 2015, Jan Hubicka wrote: > > > > > > > > > > I was naiively using ->get_constructor in IPA PTA without proper > > > > checking on wheter that succeeds. Now I tried to use ctor_for_folding > > > > but that isn't good as we want to a

Re: [PATCH] Fix PR66705

2015-09-02 Thread Jan Hubicka
> > Hmm, no, ipa-ref list should be enough (unless we start field-sensitive > analysis or need NULL inits for correctness). Still have to figure out > how to walk the list and how the reference would look like (what > is ref->use? IPA_REF_ADDR? can those be speculative?) Yep, it should be IPA_

Re: [PATCH] Fix PR66705

2015-09-02 Thread Richard Biener
On Wed, 2 Sep 2015, Richard Biener wrote: > On Wed, 2 Sep 2015, Jan Hubicka wrote: > > > > > > > I was naiively using ->get_constructor in IPA PTA without proper > > > checking on wheter that succeeds. Now I tried to use ctor_for_folding > > > but that isn't good as we want to analyze non-const

Re: [PATCH] Fix PR66705

2015-09-02 Thread Richard Biener
On Wed, 2 Sep 2015, Jan Hubicka wrote: > > > > I was naiively using ->get_constructor in IPA PTA without proper > > checking on wheter that succeeds. Now I tried to use ctor_for_folding > > but that isn't good as we want to analyze non-const globals in IPA > > PTA and we need to analyze their in

Re: [PATCH] Fix PR66705

2015-09-02 Thread Jan Hubicka
> > I was naiively using ->get_constructor in IPA PTA without proper > checking on wheter that succeeds. Now I tried to use ctor_for_folding > but that isn't good as we want to analyze non-const globals in IPA > PTA and we need to analyze their initialiers as well. > > Thus I'm trying below with

[PATCH] Fix PR66705

2015-09-02 Thread Richard Biener
I was naiively using ->get_constructor in IPA PTA without proper checking on wheter that succeeds. Now I tried to use ctor_for_folding but that isn't good as we want to analyze non-const globals in IPA PTA and we need to analyze their initialiers as well. Thus I'm trying below with ctor_for_anal