On 13 September 2012 06:50, Stefan Weil <s...@weilnetz.de> wrote: > Am 12.09.2012 23:18, schrieb Peter Maydell: >> This makes the array zero-length for 32 bit targets, but functions >> like tcg_out_tlb_load() and tcg_out_qemu_ld() still unconditionally >> access elements in it...
> Thanks for the hint. I'm afraid there are a lot more functions > of that kind in i386/tcg-target.c. > > I could use conditional compilation for those accesses, > but first I'd like to understand why this works at all. The functions in question are generating code that needs to use some temporary registers. (As RTH says, this lines up with the L constraint marking those registers as not usable for the relevant TCG operands.) To avoid unnecessary register copies in the old pre-commit-6a18ae2d register-based calling convention, they are forcing those temporary registers to be the same as some of the registers that were used for function arguments. Now we no longer use a register-based calling convention it doesn't matter which registers we use as long as the functions and the constraint definitions match up. The only tricky bit will be that the 64-bit-target cases do still care about using the same registers as are used for function inputs. -- PMM