Re: how to get the field_id for member of structure in gcc front end

2006-03-29 Thread Daniel Berlin
On Wed, 2006-03-29 at 15:03 +0800, Tianwei Sheng wrote: > I need the field_info to help in alias analysis. for example: > int *p = &pair.a; > int *q = &pair.b; > > then if I can set length of "*p" to 4,ofset is '0' . for "*q" to > "8,4". also I know that p definitly points to pair.a and q points t

Re: how to get the field_id for member of structure in gcc front end

2006-03-29 Thread Mike Stump
On Mar 29, 2006, at 12:15 AM, Tianwei Sheng wrote: but it's my be too aggressive. as you said, you mean "base,ofst" rule is enough, a more safe method is "base,ofst, lenght" rule. Right. I didn't mean to exclude length, just that I didn't expound on the idea, as I wanted to get the simple

Re: how to get the field_id for member of structure in gcc front end

2006-03-29 Thread Tianwei Sheng
but it's my be too aggressive. as you said, you mean "base,ofst" rule is enough, a more safe method is "base,ofst, lenght" rule. p still can point to pair.b if p is update by assignment or other ways. we should ensure *p will never exceed the length, otherwilse it will fail to do alias analysis.

Re: how to get the field_id for member of structure in gcc front end

2006-03-28 Thread Mike Stump
On Mar 28, 2006, at 11:03 PM, Tianwei Sheng wrote: I need the field_info to help in alias analysis. for example: int *p = &pair.a; int *q = &pair.b; then if I can set length of "*p" to 4,ofset is '0' . for "*q" to "8,4". also I know that p definitly points to pair.a and q points to pair.b, then

Re: how to get the field_id for member of structure in gcc front end

2006-03-28 Thread Tianwei Sheng
I need the field_info to help in alias analysis. for example: int *p = &pair.a; int *q = &pair.b; then if I can set length of "*p" to 4,ofset is '0' . for "*q" to "8,4". also I know that p definitly points to pair.a and q points to pair.b, then i can say "*p" and "*q" are not aliased with each oth

how to get the field_id for member of structure in gcc front end

2006-03-28 Thread Tianwei Sheng
Hi all: for the following statement, how can I get the field_id info for the structure member struct{ int a; int b; } pair; int main() { int * p = &pair.a; } It seems that we can't get the field_id info because of address taken operator. it treats the "&pair.a" as "&pair + ofset of a".