From nobody Fri May 17 03:39:38 2024 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=1654197161; cv=none; d=zohomail.com; s=zohoarc; b=l3JZ4wunN/axHl/Fc0KnIET4TMnH53JbJhxqdJ20fSYDzj0IMo/nfuEcyt2aw654k/dUPm+qvlQihm+eck99T3B2hvo5LiAhvRgEAIbPBciv0j8728gOBB8w7mByYffDz1hiJn+9D0fwN+zANvJ6hhRAQ/j8hJZWEc7oIwhpNTM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1654197161; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=DCPIn/2eQw1cUfP7alZxGtkDHu/v05BRFfK1JW6940g=; b=mf2AUGPJgEbFWSEG9j41yLGje9MdKg5eU7WKbB3A12jBRlEotShRSEzkAqi2V2MGj6mBdgEheHq5Ty99jXoW4c6FnWotQLnb/zFPcZbrkGWPA0EmcTJMgQ7rP54rFTDnN8NDgbSvMJGgcMLDBsosHszPy9HQlEK+hjnnB2+/Z7o= 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 1654197161906273.231349575516; Thu, 2 Jun 2022 12:12:41 -0700 (PDT) Received: from localhost ([::1]:39912 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nwqFM-0003Q3-VA for importer@patchew.org; Thu, 02 Jun 2022 15:12:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35254) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nwqDh-0001ix-NP; Thu, 02 Jun 2022 15:10:57 -0400 Received: from mail-oa1-x30.google.com ([2001:4860:4864:20::30]:40766) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nwqDf-00043M-R7; Thu, 02 Jun 2022 15:10:57 -0400 Received: by mail-oa1-x30.google.com with SMTP id 586e51a60fabf-f2cd424b9cso7937733fac.7; Thu, 02 Jun 2022 12:10:55 -0700 (PDT) Received: from balboa.ibmuc.com ([152.250.93.219]) by smtp.gmail.com with ESMTPSA id a30-20020a9d725e000000b0060603221262sm2539567otk.50.2022.06.02.12.10.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jun 2022 12:10:53 -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:mime-version :content-transfer-encoding; bh=DCPIn/2eQw1cUfP7alZxGtkDHu/v05BRFfK1JW6940g=; b=Qy314tLZzFCwKlH3+yGmO/hO/gZfanEdWU3MZOedR8ayac8FxptjxiiOVgKNfng9m/ ssKQZSlSfnuuc93TBILuszIaKnzqw9cvmRk1uzrWXbdaeuNj/evvwFoUBoHURd7rwyhO qdWdX7XPCNv3fxo5j2FWnwEUjRltlajBsxHWXGDz25ZVECbnC4OuyHTT3imYYVNxxme/ 1UsQWl1f1hPnTjqOxUvqaZf6DlyeV2nqGWM8bMg4hu+/KiKvKQqGtYkPCM1bTvQZWQqA vV7fTNviqH7223jfQ9maqou+HO6xhVxkLQ0wHUzbaAqOv/xEiEL3/FWVTLKJ2JQyLaK3 ABRw== 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:mime-version :content-transfer-encoding; bh=DCPIn/2eQw1cUfP7alZxGtkDHu/v05BRFfK1JW6940g=; b=R74vTp1UvLZPHT2qfO0FJ/bgqsJNeE3P1f2uCds4RIRYj/JRyYT4lhQxbRZ8T5BUys UIVnsYg4Cm80ax3W6ozw2t6wIppwEmQC3qnenyq90Cl+4I/7I4BkobOk10RshAQG8z3k EoFpXWz6jyPWwF7oI+PI8Dt+hYDdqZvKB2mbc6LWBvASpBcdFDqyEpKQlJ4Hdump/Q/v X0M/WBXWdMhb1ze53aT7CJMKZv9FUXoxtjYHij73S0yq+6OVOl5VBSJprfyxisP9ZAz1 7aYSwbSrzdDyVYxON17Ilar1WZIIWFYizF32VZ1uB1sFwT0ba29BJiXT93BQMlJ9UnCx 9T/w== X-Gm-Message-State: AOAM533YklC0xu/EC5pK/0vIhJIV9dBh8Gk6AoSra9CM3uTN5fy59Lkq TSdYiqrVUmftZ5HXZ6i4kDZnts/ZVpUZ/w== X-Google-Smtp-Source: ABdhPJw04WmHb1mlXnlsZjT8DTWPJE5gNlj8U2Bf4IsB5Ui2iobuaOInY8uwbsGncthxZpd5+1QSwg== X-Received: by 2002:a05:6870:d211:b0:f2:91f4:3dfb with SMTP id g17-20020a056870d21100b000f291f43dfbmr3661711oac.226.1654197053912; Thu, 02 Jun 2022 12:10:53 -0700 (PDT) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, clg@kaod.org, Daniel Henrique Barboza , Lucas Mateus Castro , Richard Henderson Subject: [PATCH] target/ppc: fix unreachable code in fpu_helper.c Date: Thu, 2 Jun 2022 16:10:48 -0300 Message-Id: <20220602191048.137511-1-danielhb413@gmail.com> X-Mailer: git-send-email 2.36.1 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=2001:4860:4864:20::30; envelope-from=danielhb413@gmail.com; helo=mail-oa1-x30.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: 1654197162898100001 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) --- 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