On 1/6/20 11:57 AM, [email protected] wrote:
> From: Pan Nengyuan <[email protected]>
>
> Fixes:
> target/arm/translate-a64.c: In function 'disas_crypto_three_reg_sha512':
> target/arm/translate-a64.c:13625:9: error: 'genfn' may be used uninitialized
> in this function [-Werror=maybe-uninitialized]
> genfn(tcg_rd_ptr, tcg_rn_ptr, tcg_rm_ptr);
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> qemu/target/arm/translate-a64.c:13609:8: error: 'feature' may be used
> uninitialized in this function [-Werror=maybe-uninitialized]
> if (!feature) {
>
> Reported-by: Euler Robot <[email protected]>
> Signed-off-by: Pan Nengyuan <[email protected]>
> Cc: Peter Maydell <[email protected]>
Are you compiling with reduced optimization? The compiler should be able to
prove that these variables are initialized. It certainly does with -O2, on all
known gcc versions.
Perhaps a better fix is to add a
default:
g_assert_not_reached();
entry to the o == 0 switch. Though of course opcode must be in [0-3], based on
the extraction mask, so a default label isn't actually reachable. But that's
the only path I can see for which incomplete optimization would fail to prove
initialization.
r~