diff options
author | Mike Frysinger <vapier@gentoo.org> | 2023-12-24 05:21:30 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2024-01-01 10:56:08 -0500 |
commit | f793be444cc72d818064b0c9b98ecd25f781a38d (patch) | |
tree | 7720d19175867bae845290952ed1ffbd44eeb993 /sim | |
parent | 361a6d49c6526dcff3b530c8ceefcce95fe1b9d0 (diff) | |
download | gdb-f793be444cc72d818064b0c9b98ecd25f781a38d.zip gdb-f793be444cc72d818064b0c9b98ecd25f781a38d.tar.gz gdb-f793be444cc72d818064b0c9b98ecd25f781a38d.tar.bz2 |
sim: frv: fix cmpb uninitialized variable usage
This code sets up the cc variable based on the comparison of other
registers, but it does so incrementally with bit operations, and it
never initializes the cc variable. Initialize it to 0 which the
cmpba insn is already doing.
Diffstat (limited to 'sim')
-rw-r--r-- | sim/frv/sem.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sim/frv/sem.c b/sim/frv/sem.c index 20ac47b..cf47aff 100644 --- a/sim/frv/sem.c +++ b/sim/frv/sem.c @@ -3055,6 +3055,7 @@ SEM_FN_NAME (frvbf,cmpb) (SIM_CPU *current_cpu, SEM_ARG sem_arg) { QI tmp_cc; + tmp_cc = 0; if (EQBI (EQSI (ANDSI (GET_H_GR (FLD (f_GRi)), 0xff000000), ANDSI (GET_H_GR (FLD (f_GRj)), 0xff000000)), 0)) { tmp_cc = ANDQI (tmp_cc, 7); } else { |