Following this question: http://stackoverflow.com/questions/3807480/weird-mips-assembler-behavior-with-jump-and-link-instruction I have a working GNU assembly toolchain for my single cycle MIPS project (no branch delay slot!). I would really prefer to write in C though. The code itself generated from the compiler does run, but I have to manually edit the assembly source every time since GCC for some reason likes to automatically reorder the branching instructions itself. I don't want to hack this with a script to figure out when to reorder the branches back again.
Is there a possible way to circumvent this? GCC generates code like this for some reason:
.set noreorder
...
jr $ra <-- GCC reordered for me!
addi $v0, $v0, 10 <--
...
.set reorder
where I really want to feed the assembler something like this:
.set noreorder
addi $v0, $v0, 10
jr $ra