On 05/17/2011 11:46 AM, Aurelien Jarno wrote:
>> -    tcg_set_frame(s, TCG_AREG0, offsetof(CPUState, temp_buf),
>> -                  CPU_TEMP_BUF_NLONGS * sizeof(long));
>>  }
> 
> Note that this patch is likely to break calls to helpers which need
> parameters on the stack, by judging at the current code (I haven't 
> tested it in practice):
> 
> |     if (allocate_args) {
> |         tcg_out_addi(s, TCG_REG_CALL_STACK, -STACK_DIR(call_stack_size));
> |     }
> 
> The stack register (esp) is decreased.

I don't think this ever happens in practice, given that we've already
allocated TCG_STATIC_CALL_ARGS_SIZE worth of stack for calls.  For 
i386, that's 32 int-sized arguments, well more than any helper needs.

This code in tcg.c is way too simplistic to actually work on targets
with non-trivial stack allocation policies, e.g. ppc64.  The fact 
that the target works at present is testament to the fact that this
code doesn't actually trigger.  I would be just as happy to remove
this dynamic stack allocation code and replace it with an assert.



r~

Reply via email to