Skip to content

Commit

Permalink
target/hexagon: reduce scope of def_regnum, remove dead assignment
Browse files Browse the repository at this point in the history
This is intended to address a coverity finding: CID 1527408.

Signed-off-by: Brian Cain <bcain@quicinc.com>
Reviewed-by: Matheus Tavares Bernardino <quic_mathbern@quicinc.com>
Message-Id: <20240114234453.4114587-1-bcain@quicinc.com>
  • Loading branch information
androm3da committed Jan 22, 2024
1 parent cbb9d71 commit bbe4209
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions target/hexagon/mmvec/decode_ext_mmvec.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ check_new_value(Packet *pkt)
const char *dststr = NULL;
uint16_t def_opcode;
char letter;
int def_regnum;

for (i = 1; i < pkt->num_insns; i++) {
uint16_t use_opcode = pkt->insn[i].opcode;
Expand Down Expand Up @@ -78,15 +77,14 @@ check_new_value(Packet *pkt)
}
}
if ((dststr == NULL) && GET_ATTRIB(def_opcode, A_CVI_GATHER)) {
def_regnum = 0;
pkt->insn[i].regno[use_regidx] = def_oreg;
pkt->insn[i].new_value_producer_slot = pkt->insn[def_idx].slot;
} else {
if (dststr == NULL) {
/* still not there, we have a bad packet */
g_assert_not_reached();
}
def_regnum = pkt->insn[def_idx].regno[dststr - reginfo];
int def_regnum = pkt->insn[def_idx].regno[dststr - reginfo];
/* Now patch up the consumer with the register number */
pkt->insn[i].regno[use_regidx] = def_regnum ^ def_oreg;
/* special case for (Vx,Vy) */
Expand Down

0 comments on commit bbe4209

Please sign in to comment.