This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Updating the CFG on the fly?
- To: law at cygnus dot com
- Subject: Re: Updating the CFG on the fly?
- From: Michael Hayes <m dot hayes at elec dot canterbury dot ac dot nz>
- Date: Thu, 11 Nov 1999 19:21:24 +1300 (NZDT)
- Cc: Michael Hayes <m dot hayes at elec dot canterbury dot ac dot nz>,Richard Henderson <rth at cygnus dot com>, gcc at gcc dot gnu dot org
- References: <"14377.13804.320548.473638"@ongaonga.elec.canterbury.ac.nz><4255.942251429@upchuck>
Jeffrey A Law writes:
> What does this look like at the source level? And what does it look like as
> soon as we've finished initial RTL generation?
The source code follows. Unfortunately, we cannot create a CFG before
the JUMP_LABELSs have been set up, but eyeballing the .rtl pass for
the C4x and i386 targets, this structure is apparent even before the
jump optimiser screws things around.
Michael.
typedef struct
{
int *buffer;
int *rd_pointer;
int *wr_pointer;
} dn;
static dn dw[1] =
{
{ 0 ,0 ,0 },
};
int f(int id)
{
dn *d = &dw[id];
int *len;
int size;
for (;;)
{
if (*d->rd_pointer == -1)
{
d->rd_pointer = d->buffer;
if (d->rd_pointer != d->wr_pointer)
{
len = &d->rd_pointer[1];
size = *len;
if (size != -1)
break;
else
d->rd_pointer += *d->rd_pointer;
}
}
}
return size;
}