Re: how to find variable related to a virtual ssa name

2020-05-14 Thread Richard Biener via Gcc
t has though which is alias analysis. Richard. > ---Original--- > From: "Richard Biener" > Date: Wed, May 13, 2020 19:10 PM > To: "易会战"; > Cc: "gcc"; > Subject: Re: how to find variable related to a virtual ssa name > > On Wed, May 13, 2020 a

Re: how to find variable related to a virtual ssa name

2020-05-13 Thread 易会战 via Gcc
There are some other cases that I cannot get right answer. case1: interproceduure func(int*arg) { return arg[0] + arg[1] } func2() { int a[10] return func(a); } here func cannot tell arg is local var. case 2: global array point to local int *array[3] int func(int x) { int sub1[10]; int sub2[10];

Re: how to find variable related to a virtual ssa name

2020-05-13 Thread 易会战 via Gcc
Thanks, I patch a version, it can give a heap variable info. Now the curious is the patch version cannot give right answer for variable length array. for example, int func(int m, int n) { int array[m][n]; ... } here array is allocated by alloca, obviously a local variable. But the original

Re: how to find variable related to a virtual ssa name

2020-05-13 Thread Richard Biener via Gcc
8 PM > To: "易会战"; > Cc: "gcc"; > Subject: Re: how to find variable related to a virtual ssa name > > On Wed, May 13, 2020 at 11:08 AM 易会战 wrote: > > > > yes, it does not escape the function, but indeed allocate memory on heap. > > There is much

Re: how to find variable related to a virtual ssa name

2020-05-13 Thread 易会战 via Gcc
now I am working on gcc-9.3, can you give the specific code location to check not escaped heap? I try to add a flag. ---Original--- From: "Richard Biener"

Re: how to find variable related to a virtual ssa name

2020-05-13 Thread Richard Biener via Gcc
5:00 PM > To: "易会战"; > Cc: "gcc"; > Subject: Re: how to find variable related to a virtual ssa name > > On Wed, May 13, 2020 at 6:03 AM 易会战 wrote: > > > > It seems the function ptr_deref_may_alias_global_p cannot give right result. > > For example

Re: how to find variable related to a virtual ssa name

2020-05-13 Thread 易会战 via Gcc
Which pass computes the points-to info, maybe There are some details? Do you know it? ---Original--- From: "Richard Biener"

Re: how to find variable related to a virtual ssa name

2020-05-13 Thread Richard Biener via Gcc
> live at the same > time. It can be used to quickly traverse stores via use->def chains > and loads inbetween > two stores via immediate uses. > > Richard. > > > ---Original--- > > From: "Richard Biener" > > Date: Tue, May 12, 2020 22:02 PM &

Re: how to find variable related to a virtual ssa name

2020-05-12 Thread Richard Biener via Gcc
From: "Richard Biener" > Date: Tue, May 12, 2020 22:02 PM > To: "易会战"; > Cc: "gcc"; > Subject: Re: how to find variable related to a virtual ssa name > > On Tue, May 12, 2020 at 2:44 PM 易会战 via Gcc wrote: > > > > hi, I am working on gc

Re: how to find variable related to a virtual ssa name

2020-05-12 Thread 易会战 via Gcc
thanks a lot. I will check your advice. Can you give some explaination about memory ssa, and how to use it. I check internal, cannot get it. Maybe you know some examples or some more materials. ---Original--- From: "Richard Biener"

Re: how to find variable related to a virtual ssa name

2020-05-12 Thread Richard Biener via Gcc
On Tue, May 12, 2020 at 2:44 PM 易会战 via Gcc wrote: > > hi, I am working on gcc ssa name. For each function, we can traverse all > defined ssa name by macro FOR_EACH_SSA_NAME. If a ssa name is default > definition for a symbol (check SSA_NAME_IS_DEFAULT_DEF) , I can get the > symbol by