On 07/31/2010 01:45 PM, Richard Earnshaw wrote: > This is part of the reload_{in,out}hi sequences. These have always > blown my mind away and I've never fully understood when and why these > are really needed. Essentially, whenever reload may have to move something from A to B, but can't do it without a scratch reg. > In thumb1 you potentially need some sort of recovery sequence if the > compiler needs to spill a register held in r8-r14 (since these registers > can't be stored directly to memory), but why it really needs a secondary > reload escapes me -- the compiler should just copy the register to a > lo-reg and then store that (or vice-versa for a load). And I think that happens in all normal cases. For example, arithmetic operations use "l" constraints which means reload regs are LO_REGS and no scratch reg is required to move anything into or out of it. > I suggest we get rid of the pattern entirely, and the code chain that > can end up calling it (ie thumb_reload_out_hi. As below? I've had this in my last test run (before checking in the other patches) and that was successful. It has a slight change in that it uses TARGET_32BIT instead of TARGET_ARM now. It may be worthwhile as an experiment trying to delete the arm branch as well to see if that causes problems. Bernd