From nobody Mon Feb 9 19:52:28 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1655805762; cv=none; d=zohomail.com; s=zohoarc; b=K/PukFGryxLh6KQlSz0WnFySsb8Gj1zDmIA2NTJZn0xmjRf5w+/CF3MMD09M+nxw5NHsFh9EFWy4j5JMQSkC7wWOI+8e/0kJa+CggqWJEmLpMSExsn0quyGOkKiWLFr5QQHgG2/QpgP7VbSNS2ZVbJY8zccKhN7nlVW0dAmArI4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1655805762; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=4men+xRdozA/VMBJA8BCK2Zs91riJ50H73TWq8v6YLM=; b=hwJG/TgCQToX1BhbnacXIXt4/VypJeXhIAgLhe9oqGPhXo2bMlPYml26dGV8OleFCDYHQ7uM9bRyxP2DQKVPr2Gb/Jnh4lLaGV0FaNhM+E3NLuZrPFhKgB5XSBNDokJFZG8TZLqyzm0o6k1zGcd31VuxY9PyMy0bvdQbttD4Hr4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 165580576253077.00274379021084; Tue, 21 Jun 2022 03:02:42 -0700 (PDT) Received: from localhost ([::1]:34880 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o3aiW-0001VV-TB for importer@patchew.org; Tue, 21 Jun 2022 06:02:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43448) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3aR9-00080h-Or; Tue, 21 Jun 2022 05:44:43 -0400 Received: from mail-oi1-x229.google.com ([2607:f8b0:4864:20::229]:37548) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o3aR7-0007Po-3w; Tue, 21 Jun 2022 05:44:43 -0400 Received: by mail-oi1-x229.google.com with SMTP id j10so511110oih.4; Tue, 21 Jun 2022 02:44:39 -0700 (PDT) Received: from balboa.ibmuc.com ([187.34.29.129]) by smtp.gmail.com with ESMTPSA id z9-20020a9d7a49000000b0061020865f1asm7555119otm.50.2022.06.21.02.44.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jun 2022 02:44:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4men+xRdozA/VMBJA8BCK2Zs91riJ50H73TWq8v6YLM=; b=ICbuL4SLRPSHR6PEGEQdTALc7skXBF0wJrh+5ipb1WxqcVB0Mio4GoZrlYn678fDkA 3aUqxN6YzX6KnTwRA0mFQTW+lu7f6eQ/oSdcUJq1hzFg7OxZzL3nqPFKYNSJvF6kFYu7 Cei/ghyDwHaSo72zNgV49MDWLByqaY0KURvSH3GPw/ledKutk5VRPSOiPvGXvkwSZ1hT wJjkmtrtujAgswlIkUdva6Uq0i4CCfnDqCeH1CGKHEYUWWkNCaOvTeVmoeVLhmTLs+zI +BIRzOPotwK8VV+uwel8CH+0UMlbJkyM8YLSuwjK5nTp0OmJ5KzZ3RpV3168/+VwhLsx 87Dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4men+xRdozA/VMBJA8BCK2Zs91riJ50H73TWq8v6YLM=; b=PLnk3yGxSmCTw0UGW8iMfvXffNbZGEn6TLJhm822EGAYjNB2TneEEESQh2bl3yRYHn EDl6YeoxhRRYGWBjarkDh2HWhxlmAH14UPM5T4JuuosmG4rEradOdIyeoUiggYt6DfIh MCLvWK9xjDWWxo4EsGt9Ymuqx18sJ/dN/aqr2d3/jWWahEhEV3IGWh5D1FBGeRCVutUB WAOduXqoMt8D2tHVYXsMZiu9dAWoVw6bhZc0uTwvjCm0yVFwsDz1ZCI4qrXex5fZT9PO WY7imHt2oejwzWqzeFEsIKybhuNEncCXmVRtAefsZZ6pULoX/pbxzbUNa/XERUHJ1sNs IL1w== X-Gm-Message-State: AJIora90OfrKhLsxvCE4c2qCHgoHK285AS+Y+9dNmbAjlESzecuFlRVR tOye39Sy+ohZoKJFBfrKjethwkimFnmbSQ== X-Google-Smtp-Source: AGRyM1saUdJVoyyH9oxRVtROlFS8pieXd7WK+sqiA/ZtPhoaeDGd4oTJIZHxFRrSpMqgdcp29QGZug== X-Received: by 2002:a05:6808:1b0c:b0:32e:f087:b9a7 with SMTP id bx12-20020a0568081b0c00b0032ef087b9a7mr13250526oib.273.1655804678538; Tue, 21 Jun 2022 02:44:38 -0700 (PDT) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, danielhb413@gmail.com, peter.maydell@linaro.org, richard.henderson@linaro.org, Lucas Mateus Castro Subject: [PULL 14/15] target/ppc: fix unreachable code in fpu_helper.c Date: Tue, 21 Jun 2022 06:43:59 -0300 Message-Id: <20220621094400.122800-15-danielhb413@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220621094400.122800-1-danielhb413@gmail.com> References: <20220621094400.122800-1-danielhb413@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::229; envelope-from=danielhb413@gmail.com; helo=mail-oi1-x229.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1655805762916100001 Content-Type: text/plain; charset="utf-8" Commit c29018cc7395 added an env->fpscr OR operation using a ternary that checks if 'error' is not zero: env->fpscr |=3D error ? FP_FEX : 0; However, in the current body of do_fpscr_check_status(), 'error' is granted to be always non-zero at that point. The result is that Coverity is less than pleased: Control flow issues (DEADCODE) Execution cannot reach the expression "0ULL" inside this statement: "env->fpscr |=3D (error ? 1073...". Remove the ternary and always make env->fpscr |=3D FP_FEX. Cc: Lucas Mateus Castro (alqotel) Cc: Richard Henderson Fixes: Coverity CID 1489442 Fixes: c29018cc7395 ("target/ppc: Implemented xvf*ger*") Signed-off-by: Daniel Henrique Barboza Reviewed-by: Lucas Mateus Castro (alqotel) Message-Id: <20220602191048.137511-1-danielhb413@gmail.com> Signed-off-by: Daniel Henrique Barboza --- target/ppc/fpu_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/ppc/fpu_helper.c b/target/ppc/fpu_helper.c index fed0ce420a..7ab6beadad 100644 --- a/target/ppc/fpu_helper.c +++ b/target/ppc/fpu_helper.c @@ -464,7 +464,7 @@ static void do_fpscr_check_status(CPUPPCState *env, uin= tptr_t raddr) } cs->exception_index =3D POWERPC_EXCP_PROGRAM; env->error_code =3D error | POWERPC_EXCP_FP; - env->fpscr |=3D error ? FP_FEX : 0; + env->fpscr |=3D FP_FEX; /* Deferred floating-point exception after target FPSCR update */ if (fp_exceptions_enabled(env)) { raise_exception_err_ra(env, cs->exception_index, --=20 2.36.1