From patchwork Tue May 8 18:55:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 135188 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp4741581lji; Tue, 8 May 2018 11:55:46 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpC3vqgGEkZwWbG0KSxFPTgjLRGfluXjBv5KbnYbB7jz6lZFN606aThEuxunGrBHSA3GmXY X-Received: by 10.55.13.212 with SMTP id 203mr33607058qkn.1.1525805746711; Tue, 08 May 2018 11:55:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525805746; cv=none; d=google.com; s=arc-20160816; b=F1MejC8KkTEDh5oWXHzZvYcCLRS90WI3NFXmj1tZE29TB8gsYFRtaMaORp8+hlOzAY qVh3F7IK/dN4UZtx6vW+TaNkdhj+hNTOZYqL7WI3GwV2o34Zp7gXrvaM1M9aCCJBpznG GEoEo/9/POMqb/I41rgAS4Pz6Qlbhta1r+RkjF/KKja1Saa64NmN5+KDfI82GjDK8+S3 6KmkqX/wcdJgzoIUuzEOMbmd0TVWFtzv6L+ANqt8EjLnZt2eiC1yOB3FcUdC2OVUWgB+ UUHFRps3rptiS5YEEE2tA/lAX6XTKe8SmMdXOXhqKYn/zBKwXyRM+9GKrnyq2+phpiub 6BdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:message-id:date:to:from :dkim-signature:arc-authentication-results; bh=JD5Xcy+Rasc9or/ADB3Z35MCk+JNXECBZGrHr2UA2dM=; b=TGrm3EwIlAnkhr0UVbfzB+eBC5wTjoorhR78SD/Z202bjBT8Ykv+hAwVsN0TvcMcO1 PKVe3VVsyWS0DmLH56IxmSR8n5QsB1wt+bL2073AVGPy3VLpfxmUsZayD3FS7fNCRho1 qcYmMaFmuJqjCpWXZ0Pd2aGe1L1M4dOYNcTxTd95vq+MsR6h8FG2+SDi1soNaBsNi93w fpN/GgS5qFfVQ4Jq8DrbtA+h6a8BBxbb4cE7Vek7YYveFxTMZGV1m1UTazlkcbSN2Yvy 3eOi5ju+0/sk5zyDtrz/Zi4NCARgPp07ClLRNqrAkyrDqwx5dkdbzbmJiwkdjoegL0c3 8Bvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=iGKyG/OP; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id j95-v6si10871694qte.335.2018.05.08.11.55.46 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 08 May 2018 11:55:46 -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; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=iGKyG/OP; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:52911 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fG7m6-0001Lh-80 for patch@linaro.org; Tue, 08 May 2018 14:55:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60837) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fG7ln-0001LY-Uh for qemu-devel@nongnu.org; Tue, 08 May 2018 14:55:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fG7lk-0002nF-Kf for qemu-devel@nongnu.org; Tue, 08 May 2018 14:55:27 -0400 Received: from mail-pf0-x241.google.com ([2607:f8b0:400e:c00::241]:38806) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fG7lk-0002mg-F1 for qemu-devel@nongnu.org; Tue, 08 May 2018 14:55:24 -0400 Received: by mail-pf0-x241.google.com with SMTP id o76so24392319pfi.5 for ; Tue, 08 May 2018 11:55:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=JD5Xcy+Rasc9or/ADB3Z35MCk+JNXECBZGrHr2UA2dM=; b=iGKyG/OPwTWToSlvPnlI4nmiPyA9n6G6ivj2QJerN/Nj7alN0Q4J80unMlMdgqyGFV 0jMf4kg/mEu47eEVQkwcKkx3i02Ekf8o9AEfJgnW3N0iAAZ94sdCimCnyUo+yFZYK0nJ eCewh5k/p3r2fn05AGzXWUJE6fW65I1I6pN8M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=JD5Xcy+Rasc9or/ADB3Z35MCk+JNXECBZGrHr2UA2dM=; b=VHmMGT/gQzybLUDJtcF1YTEgTOj1Ioj9L+ceglePf8LtJB4cFHUmS/JLLTBPO2hYYR 4YnWKpdjFjNpDRWDuWz2Pcl+/b+e4bRDK9BiNJB/SMpMWKWS6TG8yyN7D5cwCq7ZJDSD 0Oj8FoCxAZ6lUxl4xrCxPXXiL+0ENRfxaNMW6qV5ro5BaBa9g9Q4I7gyT3RhdXPZYfK8 XVgUO/6noce1KkFT9+Poxbqb768exRAynFXK0AWVa/WAZ7DG1APFHyo0LBt1qVWKczpE VklYDrHEz6aClFoHx+0eABDB4MRPmNCAdF6ghD5w8QhC0OSatuBE472J+obMJxvSRB/x DhZQ== X-Gm-Message-State: ALQs6tB529/UrIR0wmokzyTjkfP7ujG/lbay2gDBjIIuRPxDS44o7eCb W4fKZtdTRAseXbfzQBTsTAhWPrj5bQk= X-Received: by 2002:a63:6c04:: with SMTP id h4-v6mr34192928pgc.220.1525805722701; Tue, 08 May 2018 11:55:22 -0700 (PDT) Received: from cloudburst.twiddle.net (97-113-2-170.tukw.qwest.net. [97.113.2.170]) by smtp.gmail.com with ESMTPSA id f1sm26536212pfn.52.2018.05.08.11.55.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 08 May 2018 11:55:21 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 8 May 2018 11:55:20 -0700 Message-Id: <20180508185520.23757-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::241 Subject: [Qemu-devel] [PATCH] target/m68k: Fix build Werror with gcc 8.0.1 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: peter.maydell@linaro.org, Laurent Vivier Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Fedora 28 ships with the released gcc 8. The Werror stems from the compiler finding a path through the second switch via a missing default case in which src1 is uninitialized, and not being able to prove that the missing default case is unreachable due to the first switch. Simplify the second switch to merge default with OS_LONG, which returns directly. This removes the unreachable path. Cc: Laurent Vivier Signed-off-by: Richard Henderson --- target/m68k/translate.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- 2.17.0 Reviewed-by: Laurent Vivier diff --git a/target/m68k/translate.c b/target/m68k/translate.c index e407ba2db3..44a0ac4e2e 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -2297,7 +2297,7 @@ DISAS_INSN(arith_im) im = tcg_const_i32(read_im32(env, s)); break; default: - abort(); + g_assert_not_reached(); } if (with_SR) { @@ -2317,7 +2317,8 @@ DISAS_INSN(arith_im) } src1 = gen_get_sr(s); break; - case OS_LONG: + default: + /* OS_LONG; others already g_assert_not_reached. */ disas_undef(env, s, insn); return; }