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]

Re: rtl


The size is taken care of during allocation of rtx.

Have a look at the rtx_alloc() for allocation of rtx
after some wrapping functions and macros the core code looks like (in ggc.h)

#define ggc_alloc_rtx(NSLOTS) \
((struct rtx_def *) ggc_alloc (sizeof (struct rtx_def) \
+ ((NSLOTS) - 1) * sizeof (rtunion)))

The additional size allocated takes care of fld[]

The size NSLOTS is nothing but number of fields
which is calculated in rtl.c as follows

#define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS) sizeof FORMAT - 1 ,

const unsigned char rtx_length[NUM_RTX_CODE] = {
#include "rtl.def"
};


Correct me if I am wrong.

Regards
Shekhar







N V Krishna wrote:

Hi,
In the file rtl.h I find in the definition of rtx, the field fld
is an array of size 1, declared as :

rtunion fld[1];

However, I see that there are uses as :

#define SET_DEST(RTX) ((RTX)->fld[0].rtx)
#define SET_SRC(RTX) ((RTX)->fld[1].rtx)

Am I missing something obvious?

Warm regards
Krishna

--
Your favorite stores, helpful shopping tools and great gift ideas. Experience the convenience of buying online with Shop@Netscape! http://shopnow.netscape.com/



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