Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1kXlOB-00067e-Sv for mharc-qemu-trivial@gnu.org; Wed, 28 Oct 2020 09:21:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44190) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kXlOA-00066V-Na for qemu-trivial@nongnu.org; Wed, 28 Oct 2020 09:21:18 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:26564) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kXlO8-0007S3-Tc for qemu-trivial@nongnu.org; Wed, 28 Oct 2020 09:21:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603891275; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Y4ovk9gT8cvismcR1zGM4VS/fHyqbXv8sGCpiPK5xcc=; b=dfMewl0wgoSXZfX5LBli0ht8/OQFFyjNw8JwzJRCLZvK62iKWTh8RuZ2OhRZLvjwos6cEs xz7KhnZlzawhPMBWyrgnUB/bCPWCXScmNZNUKcLfovfmTt9JsdYzFQdcvWoz+CpVvtz1FU WtcIL5mnu2b8AYKLamgGqcR9GN03LmQ= Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-362-y1waNZFLNSK6EEKxB5im_Q-1; Wed, 28 Oct 2020 09:21:00 -0400 X-MC-Unique: y1waNZFLNSK6EEKxB5im_Q-1 Received: by mail-ed1-f69.google.com with SMTP id dk5so2087705edb.20 for ; Wed, 28 Oct 2020 06:21:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Y4ovk9gT8cvismcR1zGM4VS/fHyqbXv8sGCpiPK5xcc=; b=C33Vxa3Zimy5JbT7lCnnCvvGKbWbik1GhiQZQciP8QpiJxoMj+MJ6P+x0TJVhsidVe OU7VefllLFO2UaBG8CGdcl09bEcgQKSNstTTRzixY8T0nEwsC0zffvjiqpKwsA3oFE2A hylxmoRVNQ+vPMH/V+KGgqh2uI9hu7alLeKMcraBvBOGFmqANPK6Yj73RGcX8iPDpPaK xJyfUan2CRWvN2NMexeOMIeGUd9i19clUAEP6+5R71i1fgMe1hlN0aPGgca/2tKA6yUb +zmj9MsAZ7l0NQZONJhAMPWdQAxpE1nBNNzNe5Ht58ACsS3oojWi9UqweFSzsW5nXbKL yI3Q== X-Gm-Message-State: AOAM5339P9NuVAEGSnUgzWJE/tFozBvA0i3eF94qb0uN4pWvuk34n1Zf ks1xCZS4t1GIlpM5cDTFZ7/giF5qnXo/GPhfr5wTu6ZpSc9k0UXFC5zjm5zSwqZfosHnXStUvl9 u89s1mRgcqpwqduxIyQ== X-Received: by 2002:a05:6402:1d8b:: with SMTP id dk11mr3688495edb.102.1603891259399; Wed, 28 Oct 2020 06:20:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwzDAiP3j7V1osvdE0xtPzb0R02Dc/sASqSviRhkenTeEbbwcJCfvbiyMUQbGDx0FQv4hiBJA== X-Received: by 2002:a05:6402:1d8b:: with SMTP id dk11mr3688466edb.102.1603891259207; Wed, 28 Oct 2020 06:20:59 -0700 (PDT) Received: from [192.168.1.36] (237.red-88-18-140.staticip.rima-tde.net. [88.18.140.237]) by smtp.gmail.com with ESMTPSA id se12sm2946823ejb.37.2020.10.28.06.20.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 28 Oct 2020 06:20:58 -0700 (PDT) Subject: Re: [PATCH 1/9] target/i386: silence the compiler warnings in gen_shiftd_rm_T1 To: Thomas Huth , Chen Qun , qemu-devel@nongnu.org, qemu-trivial@nongnu.org, Richard Henderson , Tony Nguyen Cc: Eduardo Habkost , zhang.zhanghailiang@huawei.com, ganqixin@huawei.com, Euler Robot , Paolo Bonzini , Richard Henderson References: <20201028041819.2169003-1-kuhn.chenqun@huawei.com> <20201028041819.2169003-2-kuhn.chenqun@huawei.com> <30ca9af0-dfc2-e236-5575-068cec679508@redhat.com> From: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= Message-ID: Date: Wed, 28 Oct 2020 14:20:56 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1 MIME-Version: 1.0 In-Reply-To: <30ca9af0-dfc2-e236-5575-068cec679508@redhat.com> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=63.128.21.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/28 01:51:10 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-0.921, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-trivial@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Oct 2020 13:21:18 -0000 +Tony On 10/28/20 1:57 PM, Thomas Huth wrote: > On 28/10/2020 05.18, Chen Qun wrote: >> The current "#ifdef TARGET_X86_64" statement affects >> the compiler's determination of fall through. >> >> When using -Wimplicit-fallthrough in our CFLAGS, the compiler showed warning: >> target/i386/translate.c: In function ‘gen_shiftd_rm_T1’: >> target/i386/translate.c:1773:12: warning: this statement may fall through [-Wimplicit-fallthrough=] >> if (is_right) { >> ^ >> target/i386/translate.c:1782:5: note: here >> case MO_32: >> ^~~~ >> >> Reported-by: Euler Robot >> Signed-off-by: Chen Qun >> --- >> Cc: Paolo Bonzini >> Cc: Richard Henderson >> Cc: Eduardo Habkost >> --- >> target/i386/translate.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/target/i386/translate.c b/target/i386/translate.c >> index caea6f5fb1..4c353427d7 100644 >> --- a/target/i386/translate.c >> +++ b/target/i386/translate.c >> @@ -1777,9 +1777,9 @@ static void gen_shiftd_rm_T1(DisasContext *s, MemOp ot, int op1, >> } else { >> tcg_gen_deposit_tl(s->T1, s->T0, s->T1, 16, 16); >> } >> - /* FALLTHRU */ >> -#ifdef TARGET_X86_64 >> + /* fall through */ >> case MO_32: >> +#ifdef TARGET_X86_64 >> /* Concatenate the two 32-bit values and use a 64-bit shift. */ >> tcg_gen_subi_tl(s->tmp0, count, 1); >> if (is_right) { > > The whole code here looks a little bit fishy to me ... in case TARGET_X86_64 > is defined, the MO_16 code falls through to MO_32 ... but in case it is not > defined, it falls through to the default case that comes after the #ifdef > block? Is this really the right thing here? If so, I think there should be > some additional comments explaining this behavior. > > Richard, maybe you could help to judge what is right here...? I think the previous discussion is this thread: https://www.mail-archive.com/qemu-devel@nongnu.org/msg632245.html