On 07/07/11 15:34, Richard Sandiford wrote: > It seems a shame to have both (return) and (simple_return). You said > that we need the distinction in order to cope with targets like ARM, > whose (return) instruction actually performs some of the epilogue too. > It feels like the load of the saved registers should really be expressed > in rtl, in parallel with the return. I realise that'd prevent > conditional returns though. Maybe there's no elegant way out...
You'd still need to deal with distinct returns for shrink-wrapped code when the full (return) expands to ldm sp, {regs..., pc} The shrink wrapped version would always be bx lr There are also cases (eg on v4T) where the Thumb return sequence sometimes has to pop into a lo register before branching to that return address, eg pop {r3} bx r3 in order to get interworking. R.