From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:39514) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QMLih-0001j7-Ap for qemu-devel@nongnu.org; Tue, 17 May 2011 10:58:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QMLig-0005Ro-7a for qemu-devel@nongnu.org; Tue, 17 May 2011 10:57:59 -0400 Received: from mail-yw0-f45.google.com ([209.85.213.45]:57215) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QMLig-0005Rg-52 for qemu-devel@nongnu.org; Tue, 17 May 2011 10:57:58 -0400 Received: by ywl41 with SMTP id 41so208585ywl.4 for ; Tue, 17 May 2011 07:57:57 -0700 (PDT) Sender: Richard Henderson Message-ID: <4DD28CF1.4030104@twiddle.net> Date: Tue, 17 May 2011 07:57:53 -0700 From: Richard Henderson MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 06/11] TCG/x86: use stack for TCG temps List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: qemu-devel On 05/14/2011 12:38 PM, Blue Swirl wrote: > - frame_size = push_size + TCG_STATIC_CALL_ARGS_SIZE; > + frame_size = push_size + TCG_STATIC_CALL_ARGS_SIZE + > + CPU_TEMP_BUF_NLONGS * sizeof(long); > frame_size = (frame_size + TCG_TARGET_STACK_ALIGN - 1) & > ~(TCG_TARGET_STACK_ALIGN - 1); > stack_addend = frame_size - push_size; > + tcg_set_frame(s, TCG_REG_ESP, 0, CPU_TEMP_BUF_NLONGS * sizeof(long)); > + > + /* Save all callee saved registers. */ > + for (i = 0; i < ARRAY_SIZE(tcg_target_callee_save_regs); i++) { > + tcg_out_push(s, tcg_target_callee_save_regs[i]); > + } > + > tcg_out_addi(s, TCG_REG_ESP, -stack_addend); Wrong argument to tcg_set_frame. The temps need to be above the outgoing call arguments, i.e. offset TCG_STATIC_CALL_ARGS_SIZE. r~