Please review next patch for Nios2 code-gen.
This huge patch includes all missing functionality needed to provide first compilation of a program that simply returns from a function.
I've added a test case that checks for "ret" instruction printed in assembly output.
Next patches will be smaller. They will bring Nios2 R1, R2 ISA, instruction lowering and etc.