Mike Frysinger wrote: > this may be worth investigating as well: > http://pcc.ludd.ltu.se/ That was actually where I started; it works pretty well, though after a couple of hours of examining the code I realised that there was a good reason why it looked like code that had been written 25 years ago and then randomly hacked ever since. It's a little opaque, which is why I ended up here. Christopher Li wrote: [...] > I would strongly recommend using the example.c rather than compile-i386.c. > If you want to do any thing interesting with the back end at all, using > the linearize byte code is the way to go. Yes, that's what I suspected --- being the more complicated file! Oh, well, I've been examining it, and it's slow beginning to make sense. However: I notice that the code seems to make use of OP_DEATHNOTE instructions to mark hardregs as being dead. However, these are only generated if track_pseudo_death(ep) is called --- and example.c never calls this. It *is*, however, called if -vdead is specified on the command line. Is this a bug in example.c or am I just misunderstanding things? (Also, the OP_DEATHNOTE instructions appear to occur *before* the instruction that uses them last --- is this so that the instruction can reuse the register is the code generator sees fit to do so?) (In addition, I notice that once liveness tracking has been done phisrc nodes get annotated with the desired shared register that the phi should occupy; suddenly, the phi stuff all makes sense.) (PS. Please don't cc me if you're also mailing the list --- I only need one copy!) -- ┌─── dg@cowlark.com ───── http://www.cowlark.com ───── │ "I have always wished for my computer to be as easy to use as my │ telephone; my wish has come true because I can no longer figure out │ how to use my telephone." --- Bjarne Stroustrup
Attachment:
signature.asc
Description: OpenPGP digital signature