From: Mike Frysinger Date: Tue, 15 Jun 2021 04:39:28 +0000 (-0400) Subject: sim: mips: fix uninitialized register use X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7b2298cbd812320c7f78d41d556ecb174cfdd675;p=binutils-gdb.git sim: mips: fix uninitialized register use In the default case, this code will read from this variable before it is initialized as a dummy access. Set it to 0 to fix the compiler warning. --- diff --git a/sim/mips/ChangeLog b/sim/mips/ChangeLog index fcc8ab34703..1e57fe54326 100644 --- a/sim/mips/ChangeLog +++ b/sim/mips/ChangeLog @@ -1,3 +1,8 @@ +2021-06-16 Mike Frysinger + + * dv-tx3904irc.c (tx3904irc_io_write_buffer): Initialize + register_value to 0. + 2021-06-16 Mike Frysinger * configure: Regenerate. diff --git a/sim/mips/dv-tx3904irc.c b/sim/mips/dv-tx3904irc.c index 0896b0fabb0..6fbe61c7f54 100644 --- a/sim/mips/dv-tx3904irc.c +++ b/sim/mips/dv-tx3904irc.c @@ -381,7 +381,7 @@ tx3904irc_io_write_buffer (struct hw *me, int reg_number = (address - controller->base_address) / 4; int reg_offset = (address - controller->base_address) % 4; unsigned_4* register_ptr; - unsigned_4 register_value; + unsigned_4 register_value = 0; /* fill in entire register_value word */ switch (reg_number)