From patchwork Thu Apr 21 08:48:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aurelien Jarno X-Patchwork-Id: 8897401 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E5137BF29F for ; Thu, 21 Apr 2016 08:49:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4944D20260 for ; Thu, 21 Apr 2016 08:49:18 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2426620121 for ; Thu, 21 Apr 2016 08:49:17 +0000 (UTC) Received: from localhost ([::1]:37194 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1atAIV-0008HL-Jr for patchwork-qemu-devel@patchwork.kernel.org; Thu, 21 Apr 2016 04:49:15 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42790) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1atAIL-0008Ae-GG for qemu-devel@nongnu.org; Thu, 21 Apr 2016 04:49:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1atAIK-0002DA-0p for qemu-devel@nongnu.org; Thu, 21 Apr 2016 04:49:05 -0400 Received: from hall.aurel32.net ([2001:bc8:30d7:100::1]:49331) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1atAIJ-0002CP-Na for qemu-devel@nongnu.org; Thu, 21 Apr 2016 04:49:03 -0400 Received: from ohm.aurel32.net ([2001:bc8:30d7:111::1000]) by hall.aurel32.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1atAIA-00041i-Ia; Thu, 21 Apr 2016 10:48:54 +0200 Received: from aurel32 by ohm.aurel32.net with local (Exim 4.87) (envelope-from ) id 1atAIA-0003sH-74; Thu, 21 Apr 2016 10:48:54 +0200 From: Aurelien Jarno To: qemu-devel@nongnu.org Date: Thu, 21 Apr 2016 10:48:50 +0200 Message-Id: <1461228530-14852-2-git-send-email-aurelien@aurel32.net> X-Mailer: git-send-email 2.8.0.rc3 In-Reply-To: <1461228530-14852-1-git-send-email-aurelien@aurel32.net> References: <1461228530-14852-1-git-send-email-aurelien@aurel32.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:bc8:30d7:100::1 Subject: [Qemu-devel] [PATCH 2/2] tcg: check for CONFIG_DEBUG_TCG instead of NDEBUG X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Aurelien Jarno , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Check for CONFIG_DEBUG_TCG instead of NDEBUG, drop now useless code. Cc: Richard Henderson Signed-off-by: Aurelien Jarno --- tcg/aarch64/tcg-target.inc.c | 4 ++-- tcg/arm/tcg-target.inc.c | 2 +- tcg/i386/tcg-target.inc.c | 2 +- tcg/ia64/tcg-target.inc.c | 2 +- tcg/mips/tcg-target.inc.c | 2 +- tcg/ppc/tcg-target.inc.c | 2 +- tcg/s390/tcg-target.inc.c | 2 +- tcg/sparc/tcg-target.inc.c | 2 +- tcg/tcg.c | 9 ++------- tcg/tci/tcg-target.inc.c | 2 +- 10 files changed, 12 insertions(+), 17 deletions(-) diff --git a/tcg/aarch64/tcg-target.inc.c b/tcg/aarch64/tcg-target.inc.c index f5f0ce3..a8fb442 100644 --- a/tcg/aarch64/tcg-target.inc.c +++ b/tcg/aarch64/tcg-target.inc.c @@ -18,14 +18,14 @@ makes things much cleaner. */ QEMU_BUILD_BUG_ON(TCG_TYPE_I32 != 0 || TCG_TYPE_I64 != 1); -#ifndef NDEBUG +#ifdef CONFIG_DEBUG_TCG static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = { "%x0", "%x1", "%x2", "%x3", "%x4", "%x5", "%x6", "%x7", "%x8", "%x9", "%x10", "%x11", "%x12", "%x13", "%x14", "%x15", "%x16", "%x17", "%x18", "%x19", "%x20", "%x21", "%x22", "%x23", "%x24", "%x25", "%x26", "%x27", "%x28", "%fp", "%x30", "%sp", }; -#endif /* NDEBUG */ +#endif /* CONFIG_DEBUG_TCG */ static const int tcg_target_reg_alloc_order[] = { TCG_REG_X20, TCG_REG_X21, TCG_REG_X22, TCG_REG_X23, diff --git a/tcg/arm/tcg-target.inc.c b/tcg/arm/tcg-target.inc.c index 9995b74..2b7fbdd 100644 --- a/tcg/arm/tcg-target.inc.c +++ b/tcg/arm/tcg-target.inc.c @@ -67,7 +67,7 @@ bool use_idiv_instructions; # define USING_SOFTMMU 0 #endif -#ifndef NDEBUG +#ifdef CONFIG_DEBUG_TCG static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = { "%r0", "%r1", diff --git a/tcg/i386/tcg-target.inc.c b/tcg/i386/tcg-target.inc.c index 65f0d4c..007407c 100644 --- a/tcg/i386/tcg-target.inc.c +++ b/tcg/i386/tcg-target.inc.c @@ -24,7 +24,7 @@ #include "tcg-be-ldst.h" -#ifndef NDEBUG +#ifdef CONFIG_DEBUG_TCG static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = { #if TCG_TARGET_REG_BITS == 64 "%rax", "%rcx", "%rdx", "%rbx", "%rsp", "%rbp", "%rsi", "%rdi", diff --git a/tcg/ia64/tcg-target.inc.c b/tcg/ia64/tcg-target.inc.c index 5233da1..7557e6a 100644 --- a/tcg/ia64/tcg-target.inc.c +++ b/tcg/ia64/tcg-target.inc.c @@ -27,7 +27,7 @@ * Register definitions */ -#ifndef NDEBUG +#ifdef CONFIG_DEBUG_TCG static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = { "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", diff --git a/tcg/mips/tcg-target.inc.c b/tcg/mips/tcg-target.inc.c index f7194b6..aaf881c 100644 --- a/tcg/mips/tcg-target.inc.c +++ b/tcg/mips/tcg-target.inc.c @@ -35,7 +35,7 @@ #define LO_OFF (MIPS_BE * 4) #define HI_OFF (4 - LO_OFF) -#ifndef NDEBUG +#ifdef CONFIG_DEBUG_TCG static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = { "zero", "at", diff --git a/tcg/ppc/tcg-target.inc.c b/tcg/ppc/tcg-target.inc.c index 60bcaa7..00bb90f 100644 --- a/tcg/ppc/tcg-target.inc.c +++ b/tcg/ppc/tcg-target.inc.c @@ -89,7 +89,7 @@ static bool have_isa_2_06; #define TCG_GUEST_BASE_REG 30 #endif -#ifndef NDEBUG +#ifdef CONFIG_DEBUG_TCG static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = { "r0", "r1", diff --git a/tcg/s390/tcg-target.inc.c b/tcg/s390/tcg-target.inc.c index 8b30256..5805532 100644 --- a/tcg/s390/tcg-target.inc.c +++ b/tcg/s390/tcg-target.inc.c @@ -221,7 +221,7 @@ typedef enum S390Opcode { RX_STH = 0x40, } S390Opcode; -#ifndef NDEBUG +#ifdef CONFIG_DEBUG_TCG static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = { "%r0", "%r1", "%r2", "%r3", "%r4", "%r5", "%r6", "%r7", "%r8", "%r9", "%r10" "%r11" "%r12" "%r13" "%r14" "%r15" diff --git a/tcg/sparc/tcg-target.inc.c b/tcg/sparc/tcg-target.inc.c index d64daba..d641cfd 100644 --- a/tcg/sparc/tcg-target.inc.c +++ b/tcg/sparc/tcg-target.inc.c @@ -24,7 +24,7 @@ #include "tcg-be-null.h" -#ifndef NDEBUG +#ifdef CONFIG_DEBUG_TCG static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = { "%g0", "%g1", diff --git a/tcg/tcg.c b/tcg/tcg.c index 525d5c8..796addd 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -31,11 +31,6 @@ /* Define to jump the ELF file used to communicate with GDB. */ #undef DEBUG_JIT -#if !defined(CONFIG_DEBUG_TCG) && !defined(NDEBUG) -/* define it to suppress various consistency checks (faster) */ -#define NDEBUG -#endif - #include "qemu/cutils.h" #include "qemu/host-utils.h" #include "qemu/timer.h" @@ -1586,7 +1581,7 @@ static void tcg_liveness_analysis(TCGContext *s) } #endif -#ifndef NDEBUG +#ifdef CONFIG_DEBUG_TCG static void dump_regs(TCGContext *s) { TCGTemp *ts; @@ -2454,7 +2449,7 @@ int tcg_gen_code(TCGContext *s, TranslationBlock *tb) tcg_reg_alloc_op(s, def, opc, args, dead_args, sync_args); break; } -#ifndef NDEBUG +#ifdef CONFIG_DEBUG_TCG check_regs(s); #endif /* Test for (pending) buffer overflow. The assumption is that any diff --git a/tcg/tci/tcg-target.inc.c b/tcg/tci/tcg-target.inc.c index 6855ed2..e2fc52a 100644 --- a/tcg/tci/tcg-target.inc.c +++ b/tcg/tci/tcg-target.inc.c @@ -315,7 +315,7 @@ static const int tcg_target_call_oarg_regs[] = { #endif }; -#ifndef NDEBUG +#ifdef CONFIG_DEBUG_TCG static const char *const tcg_target_reg_names[TCG_TARGET_NB_REGS] = { "r00", "r01",