> One imagines that one would construct a virtual machine architecture
> framework 

gcc already has one. It's called RTL.

> and then write a back-end that would generate "machine code" for 
> that virtual machine, which would be a subset of ANSI C.  Hey-presto, you
> then have a butt-ugly anything-to-ANSI-C translator, that (whoops) loses
> any
> back-end-specific
> optimizations.

Treating C like an overgrown assembly language is certainly possible. 
Whether there's any benefit in doing that compared to writing a proper backend 
for whatever cpu you're interested in, or emulating  a common/simple cpu, is 
a completely different question.

Maintaining a gcc backend of any type is a significant undertaking.
Maintaining a backend for an abnormal target (eg. C source) that's unlikely to 
ever be accepted into mainstream sourced is even more so.

Paul

Reply via email to