From patchwork Thu Mar 13 14:54:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 26209 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qg0-f72.google.com (mail-qg0-f72.google.com [209.85.192.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5DBD8203AC for ; Thu, 13 Mar 2014 16:16:29 +0000 (UTC) Received: by mail-qg0-f72.google.com with SMTP id q108sf2625521qgd.3 for ; Thu, 13 Mar 2014 09:16:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list:content-type :content-transfer-encoding; bh=aaz75GkqLesjRrzyZpA2g0qvTWetwC6iSwTmeqZdiZc=; b=YG7VfYEL0vS+c0FKy81uAO8Kf4jo8hSy2IMXHQfxOeskLPufqK7USu2OcfmFwQjXvf wUm4oZ/jQMPKZJEvOy01cPCWrWiUSleXzYyQdwII7C5EEPgl3Tv48kQ8fzcY94QiL5Nx vrjut0F+hVtda9hPlfXzG7nhAu//k1niiFxEZohuaYTeTIfSq+N1rjbROtmFBvkZS28q TQWD/Hf6k+3ZY67CdcgJbRugLtBniiy6y+wJgy02E0+fIk/W7ydeq+0JFBbXv+PhhdIU oGf5nAKMrjU2E85JVlVsaC2stSidEH5gh//TU06e1ZrCuj6dgnfHxY99/77wp5ZIqu5G NprA== X-Gm-Message-State: ALoCoQnAdhrCxIzGo6uZVrRl/xBxlBTx6LoaPNnKc+MWIrHOcMdh5xPwPmID6fudbWuCgZxt/7Oj X-Received: by 10.236.209.134 with SMTP id s6mr807255yho.40.1394727388588; Thu, 13 Mar 2014 09:16:28 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.36.45 with SMTP id o42ls410166qgo.7.gmail; Thu, 13 Mar 2014 09:16:28 -0700 (PDT) X-Received: by 10.52.8.225 with SMTP id u1mr140953vda.64.1394727388438; Thu, 13 Mar 2014 09:16:28 -0700 (PDT) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id si3si979902vcb.28.2014.03.13.09.16.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Mar 2014 09:16:28 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.172 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.172; Received: by mail-vc0-f172.google.com with SMTP id la4so1380148vcb.3 for ; Thu, 13 Mar 2014 09:16:28 -0700 (PDT) X-Received: by 10.52.241.106 with SMTP id wh10mr1832381vdc.16.1394727388294; Thu, 13 Mar 2014 09:16:28 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.78.9 with SMTP id i9csp382629vck; Thu, 13 Mar 2014 09:16:28 -0700 (PDT) X-Received: by 10.224.4.5 with SMTP id 5mr3462211qap.61.1394727387545; Thu, 13 Mar 2014 09:16:27 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id h5si1565468qas.180.2014.03.13.09.16.27 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 13 Mar 2014 09:16:27 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:39765 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WO7KR-0005ah-Q5 for patch@linaro.org; Thu, 13 Mar 2014 11:13:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50739) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WO72f-0005bz-H8 for qemu-devel@nongnu.org; Thu, 13 Mar 2014 10:55:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WO72a-000604-A5 for qemu-devel@nongnu.org; Thu, 13 Mar 2014 10:55:29 -0400 Received: from cantor2.suse.de ([195.135.220.15]:59720 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WO72Z-0005zl-Px for qemu-devel@nongnu.org; Thu, 13 Mar 2014 10:55:24 -0400 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 4538D75019; Thu, 13 Mar 2014 14:55:23 +0000 (UTC) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Date: Thu, 13 Mar 2014 15:54:29 +0100 Message-Id: <1394722501-32326-27-git-send-email-afaerber@suse.de> X-Mailer: git-send-email 1.8.4.5 In-Reply-To: <1394722501-32326-1-git-send-email-afaerber@suse.de> References: <1394722501-32326-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 195.135.220.15 Cc: Peter Maydell , =?UTF-8?q?Andreas=20F=C3=A4rber?= Subject: [Qemu-devel] [PULL for-2.0-rc0 26/58] target-m68k: Remove custom qemu_assert() function X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: patch@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.172 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Peter Maydell Remove the custom qemu_assert() function defined by target-m68k/translate.c in favour of either using glib g_assert_not_reached() (for the genuinely can't-happen cases) or cpu_abort() (for the "this isn't implemented", in line with other unimplemented cases in the target). This has the benefit of silencing some clang warnings about variables used while uninitialized (which are emitted because clang can't figure out that qemu_assert(0, something) never returns. Signed-off-by: Peter Maydell Signed-off-by: Andreas Färber --- target-m68k/translate.c | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/target-m68k/translate.c b/target-m68k/translate.c index f54b94a..f747c13 100644 --- a/target-m68k/translate.c +++ b/target-m68k/translate.c @@ -110,14 +110,6 @@ void m68k_tcg_init(void) store_dummy = tcg_global_mem_new(TCG_AREG0, -8, "NULL"); } -static inline void qemu_assert(int cond, const char *msg) -{ - if (!cond) { - fprintf (stderr, "badness: %s\n", msg); - abort(); - } -} - /* internal defines */ typedef struct DisasContext { CPUM68KState *env; @@ -199,7 +191,7 @@ static inline TCGv gen_load(DisasContext * s, int opsize, TCGv addr, int sign) tcg_gen_qemu_ld32u(tmp, addr, index); break; default: - qemu_assert(0, "bad load size"); + g_assert_not_reached(); } gen_throws_exception = gen_last_qop; return tmp; @@ -233,7 +225,7 @@ static inline void gen_store(DisasContext *s, int opsize, TCGv addr, TCGv val) tcg_gen_qemu_st32(val, addr, index); break; default: - qemu_assert(0, "bad store size"); + g_assert_not_reached(); } gen_throws_exception = gen_last_qop; } @@ -437,8 +429,7 @@ static inline int opsize_bytes(int opsize) case OS_SINGLE: return 4; case OS_DOUBLE: return 8; default: - qemu_assert(0, "bad operand size"); - return 0; + g_assert_not_reached(); } } @@ -465,8 +456,7 @@ static void gen_partset_reg(int opsize, TCGv reg, TCGv val) tcg_gen_mov_i32(reg, val); break; default: - qemu_assert(0, "Bad operand size"); - break; + g_assert_not_reached(); } } @@ -495,7 +485,7 @@ static inline TCGv gen_extend(TCGv val, int opsize, int sign) tmp = val; break; default: - qemu_assert(0, "Bad operand size"); + g_assert_not_reached(); } return tmp; } @@ -669,7 +659,7 @@ static TCGv gen_ea(CPUM68KState *env, DisasContext *s, uint16_t insn, offset = read_im32(env, s); break; default: - qemu_assert(0, "Bad immediate operand"); + g_assert_not_reached(); } return tcg_const_i32(offset); default: @@ -2092,7 +2082,7 @@ DISAS_INSN(wdebug) return; } /* TODO: Implement wdebug. */ - qemu_assert(0, "WDEBUG not implemented"); + cpu_abort(env, "WDEBUG not implemented"); } DISAS_INSN(trap) @@ -2467,13 +2457,13 @@ DISAS_INSN(fbcc) DISAS_INSN(frestore) { /* TODO: Implement frestore. */ - qemu_assert(0, "FRESTORE not implemented"); + cpu_abort(env, "FRESTORE not implemented"); } DISAS_INSN(fsave) { /* TODO: Implement fsave. */ - qemu_assert(0, "FSAVE not implemented"); + cpu_abort(env, "FSAVE not implemented"); } static inline TCGv gen_mac_extract_word(DisasContext *s, TCGv val, int upper)