On 10/05/2015 06:46 PM, Steve Ellcey wrote:
One example of an issue I have run into is with the DWARF unwind generation and 'Rule 16' in dwarf2cfi.c. It assumes the AND instruction has an integer constant argument but MIPS can't do an AND with a constant like -16 so it has to put it in a register first and do the AND with the register. I just hacked that code as a temporary workaround but its the sort of x86 assumption that I have run into due to the fact that no platform other than x86 currently does dynamic stack alignment.
From what I recall of dwarf2cfi, that issue is already solved for things like additions by using the cfa_temp mechanism. Look at rule 6. I think you'd need to extend the rule 16 code to use that when it encounters a register instead of a constant.
I think time would be better spent pursuing this approach than on a register allocator hack.
Bernd