Clang + LLVM is one of the options. Alternatively, you can try redirecting lcc or Open64 .
lcc is suitable for simple, custom architectures with little hope of proper low-level optimization. LLVM is the best choice for registration machines (but will cause problems if you need, say, segmented 16-bit memory). Open64 offers almost the same level.
Retargeting gcc is also an option, but it will require much more conventional manual labor than others.
source share