From patchwork Wed Jun 10 20:39:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 187783 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp818034ilo; Wed, 10 Jun 2020 13:43:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwFtMFUwQbKbWP7JqbhozFlUoDN9Z4nERDafeZ7Gbw0KZtm17P6CyxvnZotEwk8xWnHfxAS X-Received: by 2002:a5b:581:: with SMTP id l1mr8458964ybp.478.1591821782742; Wed, 10 Jun 2020 13:43:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591821782; cv=none; d=google.com; s=arc-20160816; b=xjgb7ZjtANT3CvKFuyqy9CQYyaattc4AysO7QYMNZ6ei58oQsuMH37ZDApYURtg8In UsrQIpkC06q+k8caGTbZGeijecVhZfu5PpyOibdYtJTuBCl1akMPAB75BLdUweELajcM ONpWe7/1HhZ/nsL8bIoNZBf1TcFhsfSItrLHf0aihyXb9G5OKOMqhW30+DZX2E1jJb89 5RU7uhSYIpK+WVnYtDMCig7OIs2DGE7cBvKmEWAsshicXP8ZmCUeJ25PHsUkjVyoe+cp 0jr5Z+i9zW4akUQ3v1Xwm5L2OvMlXLmBzqdQFGfst2nuixJUyXEw6Z7ajtuwsJLlPmAX blnA== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=ChL+mQvp08NHZYyarb1xR9uQbyNLWA/IcQ/TYqhGDbM=; b=KO4wuHAg57K8QREVMcZ+a7zpsc0HfwH5GD/onY0sFACZKQ3eF2ZA6ZVD9azEwcpPDm Ebdv3hKk99hVkbEgJFqAnYr5cvk3PoDU+TPHX4vEp6Pi8E4dj54ujvrc25B/38aFH6jM RUIGSd2NnsAnyY/TBNrzamNfK+4uqf1+NP3IxXo3tl1wKP2NgqAjvpKq2xvd6YEodmFx ZH3LzB0cypySb13VvI3VicPwIgCSRBFPHMxwuyZCFvaAtV79mQHpcQ0mm2L3VqTX57rI CxFDPFhG/ZCYAPAIZ6H1+9K+xitQpkEPIMyoyhl0ZmJmFHk2Tj1XuzBb4CchD+wViD2Y Y0xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=xruTINwG; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 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. [209.51.188.17]) by mx.google.com with ESMTPS id q12si642510ybq.372.2020.06.10.13.43.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 10 Jun 2020 13:43:02 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=xruTINwG; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 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]:43696 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jj7Ys-0007Mx-7d for patch@linaro.org; Wed, 10 Jun 2020 16:43:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49208) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jj7Vu-0003VM-JB for qemu-devel@nongnu.org; Wed, 10 Jun 2020 16:39:58 -0400 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]:45480) by eggs.gnu.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jj7Vt-0007gq-Au for qemu-devel@nongnu.org; Wed, 10 Jun 2020 16:39:58 -0400 Received: by mail-pg1-x544.google.com with SMTP id n23so1487565pgb.12 for ; Wed, 10 Jun 2020 13:39:47 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=ChL+mQvp08NHZYyarb1xR9uQbyNLWA/IcQ/TYqhGDbM=; b=xruTINwGTolaWY5DT0fIhQSqySSdU3p2t4hlchwrMiVfAHn1uQEz7gWDyB8NadXW1l CPlY6wFAEug4d5cnyLE9Eo9uTsrnQJY31hmBi6cB8KQVDTNv76bcIAUGqgkIBlsEP9e3 HTgY2SZLHAlSBfGJZJTXcvmXUwL7Vuha89OLhSVhyaQxdm5dd3ELyLS5qH3iGcuhgIKw 3paNi7TWFAmR2zJWGEWaJC3llAn5bhkmtE0vyKKGPAuLF97meypRKdBxv4AqpegzNRqF 3YCTohUt/5omVbztWAp78JRXoCPCBrHI9VnU4t5je6UBS/GckqH85f+qiMPUYraXKDXj 88Ww== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=ChL+mQvp08NHZYyarb1xR9uQbyNLWA/IcQ/TYqhGDbM=; b=AkiVQrJbX66/LEISSMSZqfrpIgyAcXnWY17Tk0d0CwKnqCG19PJZW6oGlqonK1jSZn YcxEqq7cp+ViQV+rax/2EdojxLywLPznoOFCYZnTavOnCigW+euP0Uhe09D3leJsk6ze +jNxuwfxF818SOJPCybW7MhCmpKeKrYIr352TzWbkgU1LptlKV1N9thAzBVfEpTjLMnH QUrHFkqTMc5ohCrxFHOIS80MNwY/4/jEcdYf1cWI84xPG8WB3iqkoJK5sY3lsa8t6k7t fyRrjmFlK2Sm4Q1chuZJB1Vo5rlRkBk0Zs9puWFLiwspLTSyt6Y1IkkgwnJF9p7efdSg 3X5w== X-Gm-Message-State: AOAM531w0eQ2WvxcVSbC40aL8S67gAQDFGya63//HmGbOla+GN1neQLw iqlnAlRCBXgh2JEhpL6hi9hSN6JSeRs= X-Received: by 2002:aa7:9636:: with SMTP id r22mr4374452pfg.254.1591821585166; Wed, 10 Jun 2020 13:39:45 -0700 (PDT) Received: from localhost.localdomain (174-21-143-238.tukw.qwest.net. [174.21.143.238]) by smtp.gmail.com with ESMTPSA id g6sm740648pfb.164.2020.06.10.13.39.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jun 2020 13:39:44 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 1/5] fpu/softfloat: Silence 'bitwise negation of boolean expression' warning Date: Wed, 10 Jun 2020 13:39:38 -0700 Message-Id: <20200610203942.887374-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200610203942.887374-1-richard.henderson@linaro.org> References: <20200610203942.887374-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::544; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x544.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé When building with clang version 10.0.0-4ubuntu1, we get: CC lm32-softmmu/fpu/softfloat.o fpu/softfloat.c:3365:13: error: bitwise negation of a boolean expression; did you mean logical negation? [-Werror,-Wbool-operation] absZ &= ~ ( ( ( roundBits ^ 0x40 ) == 0 ) & roundNearestEven ); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fpu/softfloat.c:3423:18: error: bitwise negation of a boolean expression; did you mean logical negation? [-Werror,-Wbool-operation] absZ0 &= ~ ( ( (uint64_t) ( absZ1<<1 ) == 0 ) & roundNearestEven ); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ... fpu/softfloat.c:4273:18: error: bitwise negation of a boolean expression; did you mean logical negation? [-Werror,-Wbool-operation] zSig1 &= ~ ( ( zSig2 + zSig2 == 0 ) & roundNearestEven ); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fix by rewriting the fishy bitwise AND of two bools as an int. Suggested-by: Eric Blake Buglink: https://bugs.launchpad.net/bugs/1881004 Reviewed-by: Thomas Huth Reviewed-by: Eric Blake Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20200528155420.9802-1-philmd@redhat.com> Signed-off-by: Richard Henderson --- fpu/softfloat.c | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) -- 2.25.1 diff --git a/fpu/softfloat.c b/fpu/softfloat.c index 6c8f2d597a..5e9746c287 100644 --- a/fpu/softfloat.c +++ b/fpu/softfloat.c @@ -3362,7 +3362,9 @@ static int32_t roundAndPackInt32(bool zSign, uint64_t absZ, } roundBits = absZ & 0x7F; absZ = ( absZ + roundIncrement )>>7; - absZ &= ~ ( ( ( roundBits ^ 0x40 ) == 0 ) & roundNearestEven ); + if (!(roundBits ^ 0x40) && roundNearestEven) { + absZ &= ~1; + } z = absZ; if ( zSign ) z = - z; if ( ( absZ>>32 ) || ( z && ( ( z < 0 ) ^ zSign ) ) ) { @@ -3420,7 +3422,9 @@ static int64_t roundAndPackInt64(bool zSign, uint64_t absZ0, uint64_t absZ1, if ( increment ) { ++absZ0; if ( absZ0 == 0 ) goto overflow; - absZ0 &= ~ ( ( (uint64_t) ( absZ1<<1 ) == 0 ) & roundNearestEven ); + if (!(absZ1 << 1) && roundNearestEven) { + absZ0 &= ~1; + } } z = absZ0; if ( zSign ) z = - z; @@ -3480,7 +3484,9 @@ static int64_t roundAndPackUint64(bool zSign, uint64_t absZ0, float_raise(float_flag_invalid, status); return UINT64_MAX; } - absZ0 &= ~(((uint64_t)(absZ1<<1) == 0) & roundNearestEven); + if (!(absZ1 << 1) && roundNearestEven) { + absZ0 &= ~1; + } } if (zSign && absZ0) { @@ -3603,7 +3609,9 @@ static float32 roundAndPackFloat32(bool zSign, int zExp, uint32_t zSig, status->float_exception_flags |= float_flag_inexact; } zSig = ( zSig + roundIncrement )>>7; - zSig &= ~ ( ( ( roundBits ^ 0x40 ) == 0 ) & roundNearestEven ); + if (!(roundBits ^ 0x40) && roundNearestEven) { + zSig &= ~1; + } if ( zSig == 0 ) zExp = 0; return packFloat32( zSign, zExp, zSig ); @@ -3757,7 +3765,9 @@ static float64 roundAndPackFloat64(bool zSign, int zExp, uint64_t zSig, status->float_exception_flags |= float_flag_inexact; } zSig = ( zSig + roundIncrement )>>10; - zSig &= ~ ( ( ( roundBits ^ 0x200 ) == 0 ) & roundNearestEven ); + if (!(roundBits ^ 0x200) && roundNearestEven) { + zSig &= ~1; + } if ( zSig == 0 ) zExp = 0; return packFloat64( zSign, zExp, zSig ); @@ -3983,8 +3993,9 @@ floatx80 roundAndPackFloatx80(int8_t roundingPrecision, bool zSign, } if ( increment ) { ++zSig0; - zSig0 &= - ~ ( ( (uint64_t) ( zSig1<<1 ) == 0 ) & roundNearestEven ); + if (!(zSig1 << 1) && roundNearestEven) { + zSig0 &= ~1; + } if ( (int64_t) zSig0 < 0 ) zExp = 1; } return packFloatx80( zSign, zExp, zSig0 ); @@ -4000,7 +4011,9 @@ floatx80 roundAndPackFloatx80(int8_t roundingPrecision, bool zSign, zSig0 = UINT64_C(0x8000000000000000); } else { - zSig0 &= ~ ( ( (uint64_t) ( zSig1<<1 ) == 0 ) & roundNearestEven ); + if (!(zSig1 << 1) && roundNearestEven) { + zSig0 &= ~1; + } } } else { @@ -4270,7 +4283,9 @@ static float128 roundAndPackFloat128(bool zSign, int32_t zExp, } if ( increment ) { add128( zSig0, zSig1, 0, 1, &zSig0, &zSig1 ); - zSig1 &= ~ ( ( zSig2 + zSig2 == 0 ) & roundNearestEven ); + if ((zSig2 + zSig2 == 0) && roundNearestEven) { + zSig1 &= ~1; + } } else { if ( ( zSig0 | zSig1 ) == 0 ) zExp = 0; From patchwork Wed Jun 10 20:39:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 187780 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp816519ilo; Wed, 10 Jun 2020 13:40:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz8PID9fpONfO3AE3eAUywm+vLfCmgw9q8LFZY2a581P5pXzlgNmBY/gLTq1xjFfddJDqXJ X-Received: by 2002:a25:3103:: with SMTP id x3mr9464579ybx.36.1591821617045; Wed, 10 Jun 2020 13:40:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591821617; cv=none; d=google.com; s=arc-20160816; b=TKFj3pPVjbdEpKx9JGCW+7vCvlVsEzaM+Akb4j3KMDFJHnyxoRsl29D4tE5KZYRJCr amSBtRfWYD0K7cR1qgqSK0mvoGq3GbGYO0GmDJc/ywK4GeijuylqDMwZ49L8ftXGyfGV 7zSiVUmuPsHH9AQZ78NxpaHFIYrR3rS2rZVMGQMZ95C+jXhdQ3eJkrRhtblepzUdRk+e Ctksfl+Ov4jKEL32xXFocAc1N0FBYhOQ4r/XE0MyJBwC95Tx8uLe762XO+1+Bpmd+MYa K8rMxSnVwerbXFuJST5bEWrfVd5cIQZE5VCFl3j3tzC8NxTYpSwZEB3QwylN2Y6/Gi/S SBGQ== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=/1VQEyGIT5SioB6kHr1I24ND+09JThHqu5Yl+UsE9Vk=; b=bC0xFPWeOY4GAq4riiLRN+jt4OV6nuymbh6zVqTLHJ/Gm6WvztklIR/Lh3xQZYjwdQ YsLP0FWVGGOcNj2FuMy4i9fAa7h7EHFN++JMuPTWf9XzPdmwV09tB07e90L4tBycjbls frYRCyHl+deTYGrMYULpntSWj1e5diJahfVSBTq7wMXf+BlXQLVNl6FIvH2sbEZFTBn5 ZtczHaRwMSQnTFZzMQJFe7GA29lN1t5K0224l8CjEHBrSD0TeM59TaAqIHhWkJGbHccZ 98Bym9/uxa+JvlGIqTu1OD339MqNTTlS+YGqYmKOUFjqT+v33fzBPFsTz80aHJrR0bIb KWIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ReRT4Opb; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id x11si527283ybs.218.2020.06.10.13.40.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 10 Jun 2020 13:40:17 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ReRT4Opb; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:35302 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jj7WC-0003XJ-C2 for patch@linaro.org; Wed, 10 Jun 2020 16:40:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49152) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jj7Vs-0003Sa-Ob for qemu-devel@nongnu.org; Wed, 10 Jun 2020 16:39:56 -0400 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]:46077) by eggs.gnu.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jj7Vq-0007h2-Vz for qemu-devel@nongnu.org; Wed, 10 Jun 2020 16:39:56 -0400 Received: by mail-pf1-x442.google.com with SMTP id a127so1608853pfa.12 for ; Wed, 10 Jun 2020 13:39:48 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=/1VQEyGIT5SioB6kHr1I24ND+09JThHqu5Yl+UsE9Vk=; b=ReRT4OpbE2F7VnzIVlCibzaZIif7MzfWXFS7/+SXGR6ew5xiqe31TNe4qjjJTa7SQO eHBtRS30SFRUjKfC8GVFjiSMkAeRd6n2IZIIMs24m1lOHLIKQScQBSPNBzblSpvDyI1B K6LKI2xppQuao3ln+X6i13oRFngCgV+s5tC65PUhHM2DUbqM00k2NnqX8XSEs6Z39a6Z 3/BnyZIEr60l9b80f2HW1gPgn1khZU7XDCwW0mBXtKhNrOc1LvYDoyYaenfjuC7Jl60c tJ1vAl8MYd+gGwF2+wVH3RYUAzSc9Yan86o6hL/Hf+Qap7FSXHowZkWGylQuArEKkKXj PcZw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=/1VQEyGIT5SioB6kHr1I24ND+09JThHqu5Yl+UsE9Vk=; b=GprfeGtNEGSd94nUIb4mNHYdlzs8q5sJNEdlDYwjZkia54hRJOMaGGUd+GjxkBp/B6 sj75FFAbXyIxVBhKcHk/7sN4+8q5yWU85P/1t+bYm53PlqBMs38qnZCdSMqjYl5kYqoU wLAAv3EuqhE9iPpMbYWGP0Az0Ty6pHRNBjv88lLiHgghfMXz4jbRjDPoTrlmMuICfQlp OYHy9lQiGuSk3F2c3h1PuLlx9kurySSI/vVmPuYRY+R37DdK66M/b4qpR9H0XQdD6P80 Pe/wtNgza9EDm/TEc5sETvUEeeSf+S8eMD3Dt1a9ihZj6VYV3qaHS2k1P1J1UaBvdH3N uhPQ== X-Gm-Message-State: AOAM531sHaOOT3GUXQA9NlnzdwCRf2sbhSKoYJsn+VE5vm94a11Sm8aF ziQJYFJUe9CvDQZdZwQwnoqGwfeQj1s= X-Received: by 2002:aa7:97bd:: with SMTP id d29mr4013253pfq.262.1591821586787; Wed, 10 Jun 2020 13:39:46 -0700 (PDT) Received: from localhost.localdomain (174-21-143-238.tukw.qwest.net. [174.21.143.238]) by smtp.gmail.com with ESMTPSA id g6sm740648pfb.164.2020.06.10.13.39.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jun 2020 13:39:45 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 2/5] migration: fix xbzrle encoding rate calculation Date: Wed, 10 Jun 2020 13:39:39 -0700 Message-Id: <20200610203942.887374-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200610203942.887374-1-richard.henderson@linaro.org> References: <20200610203942.887374-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::442; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x442.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Wei Wang , "Dr . David Alan Gilbert" Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Wei Wang It's reported an error of implicit conversion from "unsigned long" to "double" when compiling with Clang 10. Simply make the encoding rate 0 when the encoded_size is 0. Fixes: e460a4b1a4 Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Richard Henderson Reported-by: Richard Henderson Signed-off-by: Wei Wang Signed-off-by: Richard Henderson --- migration/ram.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) -- 2.25.1 diff --git a/migration/ram.c b/migration/ram.c index 41cc530d9d..069b6e30bc 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -913,10 +913,8 @@ static void migration_update_rates(RAMState *rs, int64_t end_time) unencoded_size = (xbzrle_counters.pages - rs->xbzrle_pages_prev) * TARGET_PAGE_SIZE; encoded_size = xbzrle_counters.bytes - rs->xbzrle_bytes_prev; - if (xbzrle_counters.pages == rs->xbzrle_pages_prev) { + if (xbzrle_counters.pages == rs->xbzrle_pages_prev || !encoded_size) { xbzrle_counters.encoding_rate = 0; - } else if (!encoded_size) { - xbzrle_counters.encoding_rate = UINT64_MAX; } else { xbzrle_counters.encoding_rate = unencoded_size / encoded_size; } From patchwork Wed Jun 10 20:39:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 187782 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp817006ilo; Wed, 10 Jun 2020 13:41:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyVr9OC7QwaiNg9t7vp14Xv6ArJljPJDePqqJbHdIusJmEnBib1hhUrYZld9j59qAlVBU07 X-Received: by 2002:a25:50cc:: with SMTP id e195mr8783067ybb.483.1591821671972; Wed, 10 Jun 2020 13:41:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591821671; cv=none; d=google.com; s=arc-20160816; b=UfvILd8DZJqhPm31iRLuZPmE+lPlmnhdvVWstOyDXt/wF3FWSuWm6FEIqmpoMWJWtr UT7GMhqrqpdbgWit91havcL2KlAp3YsjKPjuq0V1LI1g5IN5dZA/4okcGbqvctG4Vpqk O78ytmbFCCwJ6oORJlNAoz2DEooYq6ekTnxpMzr4AJYoTmWAAnYHgMX8PupLbvPKzW3C N+bsChLzVkedACa8yMGVjWmMjN/DW/t0cmsy/GmvimhyrIL37tsLCvKR9HlVzMFBrf2d ZiklDIL0LsoZ124pTIzJhJyFRHAlZl2iTc6g0D7GynsgxmXUHsZI3pvmheApoU3PGOcM 9YYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=u1sk/YIU6t6fS+f6iDKix7y1NRK6wPD2A6SC61UJXGE=; b=apLBlMA5aAkVdst+2v6Klpd/imaJT5asz/663hPA1AnEBFY4Qo05x9o3A4F/b1zEZn o3ARI6WnDTLgf6DYT3ONuXhlc23puFe++sbvvRF/APfSrBQyjr9yVtDipaKqus02g1XS LK9u83BTFqb1eBth0bRNAvY3VrI+cJZ36+6L16/egVheineQK/DaRJb/VCxxOcefmpOQ uSwtri06HC0fzdzOzgEjMWP8w7LbuGQ1tbUhe6zDAuXhrF5AU+TZnv6RMiJkD54mLxXD /iO0OJPmShleaO5hBvT9QsQXFtP6PF7YF8XHpcGqC2yvu9uGhTdUZAeTunCEyabTmBU0 RJTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=QWdiry0J; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 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. [209.51.188.17]) by mx.google.com with ESMTPS id w66si519737ybc.388.2020.06.10.13.41.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 10 Jun 2020 13:41:11 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=QWdiry0J; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 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]:35246 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jj7X5-0003Uy-B6 for patch@linaro.org; Wed, 10 Jun 2020 16:41:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49166) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jj7Vt-0003Sz-4S for qemu-devel@nongnu.org; Wed, 10 Jun 2020 16:39:57 -0400 Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]:36774) by eggs.gnu.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jj7Vs-0007hC-0k for qemu-devel@nongnu.org; Wed, 10 Jun 2020 16:39:56 -0400 Received: by mail-pg1-x533.google.com with SMTP id t7so1504980pgt.3 for ; Wed, 10 Jun 2020 13:39:49 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=u1sk/YIU6t6fS+f6iDKix7y1NRK6wPD2A6SC61UJXGE=; b=QWdiry0JryBfLnFEa0ekOd2vxhlMwgTy6YsT8PomYJETDLv0RanM7JovtKNPpdn9+0 8bYdcIUGwkgsd2BSZO05zCpvVIG57bRUtryKcZUdFnzvQefmvcAOopXLGiehHkzkmVhw eJeRI18lLK3wdmEJ/WxlqhdRQNfT+ckyiCdhu5nDoUFeUkAfZQcDQXtOcBmC1jEA8hO8 Zm71IEtHyB2zS1Cr5UOz7XjZen15BoNWyWtTlSMoi9EKLQUSJipKv+nBF3rbxW65VOPv QPNaZhraFX0J9rloHlPj3eA2djbGnBEJPk49phu67un8ALFxOz8iI+7K32vsPJ/xvEZ7 VfYg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=u1sk/YIU6t6fS+f6iDKix7y1NRK6wPD2A6SC61UJXGE=; b=n8eiP7uuB35NhXxf0/2sg4RsY8kZQBFLoWw0p2I9lOIKRF16gQSavc7EqgtWuEU/jL pv4aG+1Bw6zGLN6o3kHHSXuaCfNOWnLI/q+nj627y5h/gxcCAmmrGUnJtKaJ8WnKKX5E zTolixgj5dv/TZK6GDOY5UehUH6dWpDKenn58cnnvE1awJZlU/CR44k+bqtub9UMkxMr GR/XoAbEMHbsbhR8Uhv3oSTdHD0CXdmI+qA25s9Eo+R4XBx7hFoQ8LPjbmakEPto4USI pW1SjYoWor8DZ7IisIQX+3tS6xU9ogkPhlPrUfcYARpjc1FkuK8uxUP04MZvpO6UsuL5 /0hw== X-Gm-Message-State: AOAM532pTljHw+RoydYZZdDSF7nnrg8KdKC9kdGus+bo1LglABOJ2mPg K6tnFc0IYB+srDbYxtKKv4cIE1Lacik= X-Received: by 2002:aa7:96b0:: with SMTP id g16mr4357312pfk.126.1591821587967; Wed, 10 Jun 2020 13:39:47 -0700 (PDT) Received: from localhost.localdomain (174-21-143-238.tukw.qwest.net. [174.21.143.238]) by smtp.gmail.com with ESMTPSA id g6sm740648pfb.164.2020.06.10.13.39.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jun 2020 13:39:47 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 3/5] configure: Clean up warning flag lists Date: Wed, 10 Jun 2020 13:39:40 -0700 Message-Id: <20200610203942.887374-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200610203942.887374-1-richard.henderson@linaro.org> References: <20200610203942.887374-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::533; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x533.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 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" Use a helper function to tidy the assembly of gcc_flags. Separate flags that disable warnings from those that enable, and sort the disable warnings to the end. Suggested-by: Eric Blake Signed-off-by: Richard Henderson --- configure | 40 ++++++++++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 10 deletions(-) -- 2.25.1 diff --git a/configure b/configure index 597e909b53..464202e375 100755 --- a/configure +++ b/configure @@ -97,6 +97,11 @@ do_cxx() { do_compiler "$cxx" "$@" } +# Append $2 to the variable named $1, with space separation +add_to() { + eval $1=\${$1:+\"\$$1 \"}\$2 +} + update_cxxflags() { # Set QEMU_CXXFLAGS from QEMU_CFLAGS by filtering out those # options which some versions of GCC's C++ compiler complain about @@ -2007,16 +2012,31 @@ if ! compile_prog "" "" ; then error_exit "You need at least GCC v4.8 or Clang v3.4 (or XCode Clang v5.1)" fi -gcc_flags="-Wold-style-declaration -Wold-style-definition -Wtype-limits" -gcc_flags="-Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers $gcc_flags" -gcc_flags="-Wno-missing-include-dirs -Wempty-body -Wnested-externs $gcc_flags" -gcc_flags="-Wendif-labels -Wno-shift-negative-value $gcc_flags" -gcc_flags="-Wno-initializer-overrides -Wexpansion-to-defined $gcc_flags" -gcc_flags="-Wno-string-plus-int -Wno-typedef-redefinition $gcc_flags" -# Note that we do not add -Werror to gcc_flags here, because that would -# enable it for all configure tests. If a configure test failed due -# to -Werror this would just silently disable some features, -# so it's too error prone. +# Accumulate -Wfoo and -Wno-bar separately. +# We will list all of the enable flags first, and the disable flags second. +# Note that we do not add -Werror, because that would enable it for all +# configure tests. If a configure test failed due to -Werror this would +# just silently disable some features, so it's too error prone. + +add_to warn_flags -Wold-style-declaration +add_to warn_flags -Wold-style-definition +add_to warn_flags -Wtype-limits +add_to warn_flags -Wformat-security +add_to warn_flags -Wformat-y2k +add_to warn_flags -Winit-self +add_to warn_flags -Wignored-qualifiers +add_to warn_flags -Wempty-body +add_to warn_flags -Wnested-externs +add_to warn_flags -Wendif-labels +add_to warn_flags -Wno-initializer-overrides +add_to warn_flags -Wexpansion-to-defined + +add_to nowarn_flags -Wno-missing-include-dirs +add_to nowarn_flags -Wno-shift-negative-value +add_to nowarn_flags -Wno-string-plus-int +add_to nowarn_flags -Wno-typedef-redefinition + +gcc_flags="$warn_flags $nowarn_flags" cc_has_warning_flag() { write_c_skeleton; From patchwork Wed Jun 10 20:39:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 187781 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp816759ilo; Wed, 10 Jun 2020 13:40:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQ+rUHLEDUa1FxRcPL2mzGaSuvQX2VAwveAcISikfgOaTkaEpvr7FZ2F43wn0syeI6Xrps X-Received: by 2002:a25:aa2a:: with SMTP id s39mr8390239ybi.296.1591821646769; Wed, 10 Jun 2020 13:40:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591821646; cv=none; d=google.com; s=arc-20160816; b=KrUnbd8qnPet/BtJUZCKVWFG1AvJM+y33tqg2HVOT086f2e8lSktuj1/h7z2MAFNOT VbMMFuBoO8maapes1KrljoMrQzeG4wavQlmDUO7YswKqjX9PHxGHpCqnBApMi9zvo3q3 5rMM5V53LqcLnzDGa8aXcWxGMQRo1afVmfPFDwzfUwu2CNfuNufuFix9DmSNjGN1wOEb I0DhPoAXg2utgvbUeeObTocp4893xWuYtcLxLciAlfJbeEnko7R5zuO7lFaVS5GWDJOc KoEwf1/lzYx/El+VPJyzlgh7AYZe1hpm/B/d3DcvDFFYRAMiT8mt45UxolXYqneu04L/ o8zA== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=h9lWVjb7H1XkkBgxSVShhNTX95JNTaemDIvGHo4y1DI=; b=GvqVNHLTTpLF0GZlKoByQf9SHIeSlDxCAX0Pi9uu+lCoOeCwGsy4N3sr/24Cb+GxbU G33mLgHdTeO66cJV/h5BV5SkHVTMsF0dxGS0oLKYBztVuqn3V6qj3PTwXErmyvuekU7r IyQeKrjjFckkTGYZwVuFXaoN8IzmaxLxF8mMwadZuq94MC1s4Mc1pRI8RKMab64umt+3 464fo6FFubyEMnboYzALRuslaaS9oA9Uj/JF43rAWOGYixHIfvypdOxpYdWJ0oWNDMKw vM0AipmAQBbuvV9skUrOMz5xAO5ZYaHpbccyNXd4Zz5M9hjLs5SifmiJ/sjnx6tI4xOr HbtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=EoPYiIoW; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 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. [209.51.188.17]) by mx.google.com with ESMTPS id k186si502294ybf.383.2020.06.10.13.40.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 10 Jun 2020 13:40:46 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=EoPYiIoW; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 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]:36514 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jj7Wg-0004IZ-3j for patch@linaro.org; Wed, 10 Jun 2020 16:40:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49324) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jj7W1-0003k0-J1 for qemu-devel@nongnu.org; Wed, 10 Jun 2020 16:40:05 -0400 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]:41226) by eggs.gnu.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jj7Vw-0007hO-Ko for qemu-devel@nongnu.org; Wed, 10 Jun 2020 16:40:05 -0400 Received: by mail-pg1-x543.google.com with SMTP id b5so548422pgm.8 for ; Wed, 10 Jun 2020 13:39:50 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=h9lWVjb7H1XkkBgxSVShhNTX95JNTaemDIvGHo4y1DI=; b=EoPYiIoWDGbiFqh/gRr04SvwHczr8aOWHQSXCVs3lpJT8euZfREjYWmeWhpLGdGD43 HbOSpFwz9ZKoBnwl9yLtqxLub31SDpEALw/9xBmsG0jlBVzCzimefcFjorXbeIG/D2Gh ldLPI6pnIQHvwfJfn/hNVeohpY/UDP+gUGsIu6oDFHSNqYoyv/JIcJ6//4DtrfjV5mL/ eINFuYMVw99Fmb9d90sm4ftZ3JtA2FgAbNVXSaIRwQJ32DVESVNZuyzxYCw3Nxye5Rt8 4Gz4GGvVfcFlkKo0r26EIY1Xq/WdCDlkgQaXFAMFM1+nPyCbEv3OKhZm70UE3+lTM+Ro cfMQ== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=h9lWVjb7H1XkkBgxSVShhNTX95JNTaemDIvGHo4y1DI=; b=hjPx0Tg86Z8xgtrTWEZHSTqwiKnDwbB+ydxryemf9d7dlwHZXs5qzwtf2NS5gmoybj Bwkgs6X5duNWQoXmoYWkUa8xzWE0MaudFZzH+j05wIu5empB7xAyb2snaW21er8ISzYp mDFiHKip4fJuqGURxwBOPym9j3rMFPXNQG5CLOHZSXk6kwOfAsoDKoNRdqpTnvtmVfwq /l3CAe+yfWWG+ZI3Ku33fxLjbNt9EMAx8FDVF4usCjL8KHK15hdqWvtF9UbAYdlST4fV XFP7DzR1SkeQMHSDLW/tLBo6luQkKp1IWPGBZNOJEVWxrB6mS8N5NzrIL/kUIWfFTDlE MFHg== X-Gm-Message-State: AOAM531SQaK8JnEpp34zq4I3dHmUDKnOFNjFE5x5gF88l+NNfIxALvs+ fdtG12NlMS1wn091QoKBYpaRoBIx614= X-Received: by 2002:a62:1c46:: with SMTP id c67mr4162269pfc.170.1591821589289; Wed, 10 Jun 2020 13:39:49 -0700 (PDT) Received: from localhost.localdomain (174-21-143-238.tukw.qwest.net. [174.21.143.238]) by smtp.gmail.com with ESMTPSA id g6sm740648pfb.164.2020.06.10.13.39.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jun 2020 13:39:48 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 4/5] configure: Disable -Wtautological-type-limit-compare Date: Wed, 10 Jun 2020 13:39:41 -0700 Message-Id: <20200610203942.887374-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200610203942.887374-1-richard.henderson@linaro.org> References: <20200610203942.887374-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::543; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x543.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Clang 10 enables this by default with -Wtype-limit. All of the instances flagged by this Werror so far have been cases in which we really do want the compiler to optimize away the test completely. Disabling the warning will avoid having to add ifdefs to work around this. Cc: Eric Blake Fixes: https://bugs.launchpad.net/qemu/+bug/1878628 Acked-by: Thomas Huth Reviewed-by: Eric Blake Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- v2: Use the new add_to function. --- configure | 1 + 1 file changed, 1 insertion(+) -- 2.25.1 diff --git a/configure b/configure index 464202e375..8b33447048 100755 --- a/configure +++ b/configure @@ -2035,6 +2035,7 @@ add_to nowarn_flags -Wno-missing-include-dirs add_to nowarn_flags -Wno-shift-negative-value add_to nowarn_flags -Wno-string-plus-int add_to nowarn_flags -Wno-typedef-redefinition +add_to nowarn_flags -Wno-tautological-type-limit-compare gcc_flags="$warn_flags $nowarn_flags" From patchwork Wed Jun 10 20:39:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 187784 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp818933ilo; Wed, 10 Jun 2020 13:44:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTGcqNuowLyKtOL69ZMxZRZKcU4NMnJbv5DbIwSCrEwm6RsQ48McOuu7oQ6U2Vl5MyPoCB X-Received: by 2002:a25:3f87:: with SMTP id m129mr8768098yba.371.1591821888444; Wed, 10 Jun 2020 13:44:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591821888; cv=none; d=google.com; s=arc-20160816; b=vChMA2fB6/sXoAZZiGY55i1lEEa4imiFrNi7ekjT9Abas+jzAbF6/cHBHlnRjaBb5+ C/3z7SAk/k/Ipt3agAE1zaQ4dWr+SWVNz8KhJ12MRsChM47HvrJrGGAlbChalcdBeWmV P5tIbtPPQ26SMWCLKv+C3ju3G62c7FOdJ0XOVmNTnfU/39x72pyjs42w1XyxNHCM8ZcK 3QQnBjU3fd2Pd+egD8fHmMWgyfGIRVTUtO9GcqR71Jpa/FzMFihbUd2+f5tlITlpaVXH nJ7mAnZH+XVTKTQTJ5Vau675DZE1/2wLA7R1lRTkwKQxQMGrbA9opMmt7KCVFBw6qABh 1viw== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=rdRr8k9RoF6oI62onYFF+ei/xJnpiy+5iLWvNRMEmaI=; b=JeRyDA+4m5lzZhZn5zo8TRkUFzTqc082nUl4Nt1ifkCatsxSgtGLwqxctoAM+un1uS jznfAPViXWrJUlyU9oparzSQZqNhcrj+bgGU/Cqid7M+VpZxxD9ZCcPxRNGiRiBxeJ2J wngYao3P59g1gGXhJg/LlkssP3SZoAjv90j5zB/a4gxX6Qas7UHZVeZFvH/1nInUgOII HdZE7vavOk4mAFtvur5odCUQz1iLcv3XsTSIu0xryLMZznZwwy9igTb0INUoX/HJCsRv scj5ShyB3cp7HVDDGGftMwN36VoWcdr0EVG3gU3K8Dt1veTWUB40OyeLLFkDhiexBd3y xp8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=fgnH157G; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 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. [209.51.188.17]) by mx.google.com with ESMTPS id b203si505753yba.469.2020.06.10.13.44.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 10 Jun 2020 13:44:48 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=fgnH157G; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 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]:46386 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jj7aZ-00008h-TL for patch@linaro.org; Wed, 10 Jun 2020 16:44:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49224) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jj7Vv-0003Xs-EG for qemu-devel@nongnu.org; Wed, 10 Jun 2020 16:39:59 -0400 Received: from mail-pj1-x1044.google.com ([2607:f8b0:4864:20::1044]:55985) by eggs.gnu.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jj7Vu-0007hU-F0 for qemu-devel@nongnu.org; Wed, 10 Jun 2020 16:39:59 -0400 Received: by mail-pj1-x1044.google.com with SMTP id ne5so1307023pjb.5 for ; Wed, 10 Jun 2020 13:39:51 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=rdRr8k9RoF6oI62onYFF+ei/xJnpiy+5iLWvNRMEmaI=; b=fgnH157GNy39piUiVuhYZ2EEHd1hvDpNYFV/mbXwRNtKmrcv2hSqSDrQYzKBW9A1R9 499h0INvusZIAru0wkFi4TjeEwUyLcHR+cOqcyiBkuFj0ozkiWy2WFxxtVyokChpE2Oc hGJoM54QfqExU3KUaz3f/7RzimtVHXnPtvwnMSRtD+SmfldV9aHXkCHSX3zyHeBjJbUw iiZ61LPBdOM18NgRY8SEH9fdEcpx7tjMvBVeAbBu5VJRKoooGrNF14/Qxd6KV+608hOf uGQ/sU1K0DIP/vrMaJuQC6rM3xsVBQEDk6kSQLGJVhnscziGPGPh+M1qfVBk534rMkAY KWWw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=rdRr8k9RoF6oI62onYFF+ei/xJnpiy+5iLWvNRMEmaI=; b=aRQhhbkWCTpmmEVOWFCMdWfnzxYPAGG6pWCD8Lf1NkBFjQw7+bvY1hrPhLNC5lYXRK 0g83zusKDZrhVNbAlYNNXfea26KFW7jlkqNOpkGKQyotM2PTP5i8zZ5tY5e2Vk9659Ko sjDrdndEFliMKYQ8MNb6i2OZnTz+oCwC3jDknl6Vh+1dsxorrAyKJoP3c4wwKbLmZmSF 6Lu63jqtAuMZItO2aKEj9ACVOPzG19AyZAzFUAvtQpr9rdOyKkPuyc9GW17StWti4WuP Xgei6JnaJxJBNO0nx86YJtPzweEmVRk94Qvbl3V3JKt/PCfqCJHZJjftuR+VxVD8rLpJ I5rA== X-Gm-Message-State: AOAM530yg/q+k1mwbpTa0pGyNVHQ2EB6bg728ZpKt+s4JOVSA54lR70z CaxwgXO3ZFuw82zKSK4XlppydIGfYpY= X-Received: by 2002:a17:902:bd09:: with SMTP id p9mr4586962pls.214.1591821590479; Wed, 10 Jun 2020 13:39:50 -0700 (PDT) Received: from localhost.localdomain (174-21-143-238.tukw.qwest.net. [174.21.143.238]) by smtp.gmail.com with ESMTPSA id g6sm740648pfb.164.2020.06.10.13.39.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jun 2020 13:39:49 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 5/5] configure: Add -Wno-psabi Date: Wed, 10 Jun 2020 13:39:42 -0700 Message-Id: <20200610203942.887374-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200610203942.887374-1-richard.henderson@linaro.org> References: <20200610203942.887374-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1044; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1044.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" On aarch64, gcc 9.3 is generating qemu/exec.c: In function ‘address_space_translate_iommu’: qemu/exec.c:431:28: note: parameter passing for argument of type \ ‘MemTxAttrs’ {aka ‘struct MemTxAttrs’} changed in GCC 9.1 and many other reptitions. This structure, and the functions amongst which it is passed, are not part of a QEMU public API. Therefore we do not care how the compiler passes the argument, so long as the compiler is self-consistent. Cc: Alex Bennée Cc: Peter Maydell Signed-off-by: Richard Henderson --- TODO: The only portion of QEMU which does have a public api, and so must have a stable abi, is "qemu/plugin.h". We could test this by forcing -Wpsabi or -Werror=psabi in tests/plugin. I can't seem to make that work -- Alex? --- configure | 1 + 1 file changed, 1 insertion(+) -- 2.25.1 diff --git a/configure b/configure index 8b33447048..76d32e0f7b 100755 --- a/configure +++ b/configure @@ -2036,6 +2036,7 @@ add_to nowarn_flags -Wno-shift-negative-value add_to nowarn_flags -Wno-string-plus-int add_to nowarn_flags -Wno-typedef-redefinition add_to nowarn_flags -Wno-tautological-type-limit-compare +add_to nowarn_flags -Wno-psabi gcc_flags="$warn_flags $nowarn_flags"