On 8/13/20 12:37 AM, Chen Qun wrote:
> Clang static code analyzer show warning:
> tcg/optimize.c:1267:17: warning: Value stored to 'nb_iargs' is never read
>                 nb_iargs = 2;
>                 ^          ~
> 
> Reported-by: Euler Robot <euler.ro...@huawei.com>
> Signed-off-by: Chen Qun <kuhn.chen...@huawei.com>
> ---
> Cc: Richard Henderson <richard.hender...@linaro.org>
> Cc: Richard Henderson <r...@twiddle.net>
> ---
>  tcg/optimize.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/tcg/optimize.c b/tcg/optimize.c
> index 53aa8e5329..d5bea37290 100644
> --- a/tcg/optimize.c
> +++ b/tcg/optimize.c
> @@ -1264,7 +1264,6 @@ void tcg_optimize(TCGContext *s)
>                  op->opc = opc = (opc == INDEX_op_movcond_i32
>                                   ? INDEX_op_setcond_i32
>                                   : INDEX_op_setcond_i64);
> -                nb_iargs = 2;
>              }
>              goto do_default;

I prefer not to make this change.

nb_iargs is the cached value that corresponds to opc, which we have just
changed.  If we later make a change at "do_default" that uses nb_iargs, failure
to update the value here will be a very hard bug to find.

I am happy to let the compiler remove this as dead code itself.


r~

Reply via email to