dinuxbg / gnupru

GCC and Binutils port for the TI PRU I/O processor
92 stars 11 forks source link

Sibling (tail call jump optimizated) indirect call can use wrong register #4

Closed dinuxbg closed 9 years ago

dinuxbg commented 9 years ago

The following wrong code can be generated by pru-gcc for sibling calls: 20000074: f104a285 lbbo r5.b0, sp, 4, 12 20000078: 0110e2e2 add sp, sp, 16 2000007c: 20e70000 jmp r7

To fix, the sibcall insn must be modified to use only call-clobbered registers for the indirect call.

dinuxbg commented 9 years ago

Fixed in c11cca8a2c64f17ce04385ea9f78254f69b6ea7f