Simplest C compiler to retarget
Posted: Sat Jul 19, 2008 11:02 pm
I have written a virtual machine and I would like to be able to run C on this machine just for fun. The thing is, I don't have a C compiler. Now, I know that there are some compilers meant for this stuff(lcc for example), but the thing is that my virtual machine doesn't have a fixed number of registers but rather it has an arbitrary per-subroutine register number and it also has a quite high-level bytecode. What would be the simplest compiler to use for this? Should I even use a standard compiler or should I attempt to write my own(I have some experience with compiler design)? Have you successfully retargeted a compiler?
AFAICT, all the retargetable C compilers make certain assumptions about their backends, which generally means that backends only produce the most low-level code. However, since my bytecode is really high-level, I do not know if any compiler would be able to handle it.
What do you think?
AFAICT, all the retargetable C compilers make certain assumptions about their backends, which generally means that backends only produce the most low-level code. However, since my bytecode is really high-level, I do not know if any compiler would be able to handle it.
What do you think?