From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JFRtV-0005mn-I0 for qemu-devel@nongnu.org; Thu, 17 Jan 2008 05:22:45 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JFRtT-0005mF-QK for qemu-devel@nongnu.org; Thu, 17 Jan 2008 05:22:45 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JFRtT-0005mA-Hp for qemu-devel@nongnu.org; Thu, 17 Jan 2008 05:22:43 -0500 Received: from kassel160.server4you.de ([62.75.246.160] helo=csgraf.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JFRtT-0008KY-4D for qemu-devel@nongnu.org; Thu, 17 Jan 2008 05:22:43 -0500 Received: from [10.10.100.38] (charybdis-ext.suse.de [195.135.221.2]) by csgraf.de (Postfix) with ESMTP id 0355B615F for ; Thu, 17 Jan 2008 11:22:41 +0100 (CET) Message-ID: <478EF8E8.8090707@csgraf.de> Date: Thu, 17 Jan 2008 07:42:48 +0100 From: Alexander Graf MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------040401080204070401060808" Subject: [Qemu-devel] [PATCH 3/5] (PPC) Fix in-between branch returns 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 This is a multi-part message in MIME format. --------------040401080204070401060808 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Thanks to the branch detection I found several places where op.o contained branch returns somewhere not at the end of the function. This did not happen on other platforms for me, but I may be wrong. This patch adds FORCE_RET at the end of those functions, to force gcc to use a jump to the end and not return from it. The idea and most of the debugging for this comes from Michael Matz. --------------040401080204070401060808 Content-Type: text/x-patch; name="qemu-gcc4-forceret.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="qemu-gcc4-forceret.patch" Index: qemu-snapshot-2008-01-15_05/target-i386/op.c =================================================================== --- qemu-snapshot-2008-01-15_05.orig/target-i386/op.c +++ qemu-snapshot-2008-01-15_05/target-i386/op.c @@ -291,6 +291,7 @@ void OPPROTO op_imull_EAX_T0(void) EDX = (uint32_t)(res >> 32); CC_DST = res; CC_SRC = (res != (int32_t)res); + FORCE_RET(); } void OPPROTO op_imulw_T0_T1(void) @@ -300,6 +301,7 @@ void OPPROTO op_imulw_T0_T1(void) T0 = res; CC_DST = res; CC_SRC = (res != (int16_t)res); + FORCE_RET(); } void OPPROTO op_imull_T0_T1(void) @@ -309,6 +311,7 @@ void OPPROTO op_imull_T0_T1(void) T0 = res; CC_DST = res; CC_SRC = (res != (int32_t)res); + FORCE_RET(); } #ifdef TARGET_X86_64 Index: qemu-snapshot-2008-01-15_05/target-i386/ops_template.h =================================================================== --- qemu-snapshot-2008-01-15_05.orig/target-i386/ops_template.h +++ qemu-snapshot-2008-01-15_05/target-i386/ops_template.h @@ -467,6 +467,7 @@ void OPPROTO glue(glue(op_bt, SUFFIX), _ int count; count = T1 & SHIFT_MASK; CC_SRC = T0 >> count; + FORCE_RET(); } void OPPROTO glue(glue(op_bts, SUFFIX), _T0_T1_cc)(void) --------------040401080204070401060808--