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]

Re: Updating the CFG on the fly?


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;
}


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