This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Generate tree/rtx for address-of exp?


tree exp;
rtx exp_rtx;
?
Assume exp is?the tree for some varaible?and exp_rtx
is rtx for exp. The goal is to generate rtx for
address-of exp. (&i, for example).
?
If exp is var_decl, like for 
int i, 
the address-of?exp 
&i
locates at exp_rtx->fld[0].rtx.
?
However, for complex situation, like:
---
typedef struct {
? int i;
? float j;
} x;
?
x *a;
?
a->j;
---
we need the offset of j in?a to get &(a->j).
?
The questions are:
1. Is there a universal field in tree/rtx for
address-of exp? No matter what exp could be.
2. Is there?some function A that could help to
calculate the offset no matter it is structure, array
or mix?
3. Can some nice guy could should me the simple
pseudocode?for the function A if I have to write it
myself? Or what are the situations I need to think of,
like?for array, for strcuture, for arrays of strutures
etc.
?
Thanks,
Z






	
		
__________________________________
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/ 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]