This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: rtl
- From: Shekhar Divekar <shekhar at cradle dot com>
- To: N V Krishna <nvk at cs dot purdue dot edu>
- Cc: gcc at gnu dot org
- Date: Fri, 04 Oct 2002 18:36:18 +0530
- Subject: Re: rtl
- Organization: Cradle Technologies
- References: <Pine.LNX.4.44.0210040144350.16972-100000@puma.cs.purdue.edu>
- Reply-to: shekhardivekar at netscape dot net
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/