AVR back end


The backend is on the stage of being able to compile any program independently of its complexity, atleast that is the theory, any failures should get fixed. The only missing C language feature/extension I know of now is inline asm, which is currently being worked on. It has support for varargs and variable sized allocas.

The backend has support for 95% of the ISA, including all adressing modes (predec, postinc and indexed) for both data and program address spaces. Currently, the only code emission mode supported is text, in the future object file emission should be implemented, for now we require an external assembler and linker. No support now for subtargets.

Regarding optimizations, it has very few implemented. I’ve focused first on getting correct code generation for any program, and then when the backend is sort of stable get focused on getting those optimizations done.

On the frontend side, we’re using clang. We have support for ISR’s (signal and interrupt function attributes) and for the __flash keyword to store data in program memory using the named address space extension.


I haven’t tested any C++ program with the backend so no idea about that. We don’t have those sort of optimizations implemented yet so it will depend on the default llvm behaviour. It’s something that will get done in the future, aswell as storing jump/switch tables in progmem.

If you want to know any other specific thing about the backend let me know.