[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 14/15] target/ppc: fix unreachable code in fpu_helper.c
From: |
Daniel Henrique Barboza |
Subject: |
[PULL 14/15] target/ppc: fix unreachable code in fpu_helper.c |
Date: |
Tue, 21 Jun 2022 06:43:59 -0300 |
Commit c29018cc7395 added an env->fpscr OR operation using a ternary
that checks if 'error' is not zero:
env->fpscr |= 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 |= (error ? 1073...".
Remove the ternary and always make env->fpscr |= FP_FEX.
Cc: Lucas Mateus Castro (alqotel) <lucas.araujo@eldorado.org.br>
Cc: Richard Henderson <richard.henderson@linaro.org>
Fixes: Coverity CID 1489442
Fixes: c29018cc7395 ("target/ppc: Implemented xvf*ger*")
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Lucas Mateus Castro (alqotel) <lucas.araujo@eldorado.org.br>
Message-Id: <20220602191048.137511-1-danielhb413@gmail.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
---
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,
uintptr_t raddr)
}
cs->exception_index = POWERPC_EXCP_PROGRAM;
env->error_code = error | POWERPC_EXCP_FP;
- env->fpscr |= error ? FP_FEX : 0;
+ env->fpscr |= FP_FEX;
/* Deferred floating-point exception after target FPSCR update */
if (fp_exceptions_enabled(env)) {
raise_exception_err_ra(env, cs->exception_index,
--
2.36.1
- [PULL 08/15] target/ppc: Implemented vector module quadword, (continued)
- [PULL 08/15] target/ppc: Implemented vector module quadword, Daniel Henrique Barboza, 2022/06/21
- [PULL 07/15] target/ppc: Implemented vector module word/doubleword, Daniel Henrique Barboza, 2022/06/21
- [PULL 11/15] pnv/xive2: Access direct mapped thread contexts from all chips, Daniel Henrique Barboza, 2022/06/21
- [PULL 06/15] target/ppc: Implemented remaining vector divide extended, Daniel Henrique Barboza, 2022/06/21
- [PULL 09/15] ppc: fix boot with sam460ex, Daniel Henrique Barboza, 2022/06/21
- [PULL 12/15] ppc/pnv: fix extra indent spaces with DEFINE_PROP*, Daniel Henrique Barboza, 2022/06/21
- [PULL 05/15] host-utils: Implemented signed 256-by-128 division, Daniel Henrique Barboza, 2022/06/21
- [PULL 10/15] target/ppc: fix vbpermd in big endian hosts, Daniel Henrique Barboza, 2022/06/21
- [PULL 13/15] target/ppc: avoid int32 multiply overflow in int_helper.c, Daniel Henrique Barboza, 2022/06/21
- [PULL 15/15] target/ppc: cpu_init: Clean up stop state on cpu reset, Daniel Henrique Barboza, 2022/06/21
- [PULL 14/15] target/ppc: fix unreachable code in fpu_helper.c,
Daniel Henrique Barboza <=
- Re: [PULL 00/15] ppc queue, Richard Henderson, 2022/06/21