[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 08/11] tcg/optimize: Remove redundant statement in tcg_optimi
From: |
Richard Henderson |
Subject: |
Re: [PATCH 08/11] tcg/optimize: Remove redundant statement in tcg_optimize() |
Date: |
Thu, 13 Aug 2020 09:22:59 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 |
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.robot@huawei.com>
> Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
> ---
> Cc: Richard Henderson <richard.henderson@linaro.org>
> Cc: Richard Henderson <rth@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~
- Re: [PATCH 07/11] vfio/platform: Remove dead assignment in vfio_intp_interrupt(), (continued)
- Re: [PATCH 07/11] vfio/platform: Remove dead assignment in vfio_intp_interrupt(), Auger Eric, 2020/08/13
- Re: [PATCH 07/11] vfio/platform: Remove dead assignment in vfio_intp_interrupt(), Alex Williamson, 2020/08/13
- Re: [PATCH 07/11] vfio/platform: Remove dead assignment in vfio_intp_interrupt(), Auger Eric, 2020/08/13
- Re: [PATCH 07/11] vfio/platform: Remove dead assignment in vfio_intp_interrupt(), Alex Williamson, 2020/08/13
- Re: [PATCH 07/11] vfio/platform: Remove dead assignment in vfio_intp_interrupt(), Auger Eric, 2020/08/13
- Re: [PATCH 07/11] vfio/platform: Remove dead assignment in vfio_intp_interrupt(), Stefan Hajnoczi, 2020/08/18
- Re: [PATCH 07/11] vfio/platform: Remove dead assignment in vfio_intp_interrupt(), Auger Eric, 2020/08/18
[PATCH 06/11] hw/net/virtio-net:Remove redundant statement in virtio_net_rsc_tcp_ctrl_check(), Chen Qun, 2020/08/13
[PATCH 08/11] tcg/optimize: Remove redundant statement in tcg_optimize(), Chen Qun, 2020/08/13
- Re: [PATCH 08/11] tcg/optimize: Remove redundant statement in tcg_optimize(),
Richard Henderson <=
[PATCH 09/11] usb/bus: Remove dead assignment in usb_get_fw_dev_path(), Chen Qun, 2020/08/13
[PATCH 01/11] hw/arm/virt-acpi-build:Remove dead assignment in build_madt(), Chen Qun, 2020/08/13
[PATCH 11/11] hw/display/vga:Remove redundant statement in vga_draw_graphic(), Chen Qun, 2020/08/13
[PATCH 10/11] hw/intc: Remove redundant statement in exynos4210_combiner_read(), Chen Qun, 2020/08/13