#255 Don't allocate register pairs with swapped bytes

closed
None
5
2008-03-30
2008-03-20
No

When allocating of 16-bit register pairs fails the register allocator falls back to allocating two 8-bit registers indiidually. Often there's just one free 8-bit register, which is then allocated to the lower byte of the 16-bit thing looking for a place to live. For the other 8-bit register we then have to spill something. This can result in a 16-bit register pair being used, but with the upper and lower bytes swapped.
This breaks many optimizations, since instructions that operate on 16-bit register pairs can't be used.

The register allocator should detect this and swap the bytes.

Philipp

Discussion

    • status: open --> closed
     
  • Logged In: YES
    user_id=564030
    Originator: YES

    Implemented in revision #5125.