From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JzbcI-0005MC-N2 for qemu-devel@nongnu.org; Fri, 23 May 2008 14:03:46 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JzbcF-0005H9-Rb for qemu-devel@nongnu.org; Fri, 23 May 2008 14:03:45 -0400 Received: from [199.232.76.173] (port=48541 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JzbcF-0005Gy-O9 for qemu-devel@nongnu.org; Fri, 23 May 2008 14:03:43 -0400 Received: from mail.codesourcery.com ([65.74.133.4]:38551) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JzbcF-0002gW-1I for qemu-devel@nongnu.org; Fri, 23 May 2008 14:03:43 -0400 From: Paul Brook Subject: Re: [Qemu-devel] [4544] added tcg_temp_free() and improved the handling of constants Date: Fri, 23 May 2008 19:03:35 +0100 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200805231903.35923.paul@codesourcery.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org > added tcg_temp_free() and improved the handling of constants Should the return value of tcg_const_i32 et. al. be considered immutable, or is it ok to use it as a temporary? e.g.: static TCGv do_frob(TCGv base, int addend) { TCGv tmp = tcg_const_i32(addend); tcg_gen_helper_frob(tmp, tmp, base) return tmp; } or should this be written as: static TCGv do_frob(TCGv base, int addend) { TCGv tmp = tcg_temp_new(TCG_TYPE_I32); tcg_gen_movi_i32(tmp, addend); tcg_gen_helper_frob(tmp, tmp, base) return tmp; } Currently it's fairly hard to enforce this restriction automatically, but we need to decide whether it's a feature or a bug. Paul