Skip to content

Commit f4f8039

Browse files
Julien Thierryjpoimboe
authored andcommitted
objtool: Remove useless tests before save_reg()
save_reg already checks that the register being saved does not already have a saved state. Remove redundant checks before processing a register storing operation. Signed-off-by: Julien Thierry <jthierry@redhat.com> Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
1 parent edea9e6 commit f4f8039

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

tools/objtool/check.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2030,7 +2030,7 @@ static int update_cfi_state(struct instruction *insn, struct cfi_state *cfi,
20302030
/* drap: push %rbp */
20312031
cfi->stack_size = 0;
20322032

2033-
} else if (regs[op->src.reg].base == CFI_UNDEFINED) {
2033+
} else {
20342034

20352035
/* drap: push %reg */
20362036
save_reg(cfi, op->src.reg, CFI_BP, -cfi->stack_size);
@@ -2059,9 +2059,7 @@ static int update_cfi_state(struct instruction *insn, struct cfi_state *cfi,
20592059

20602060
/* save drap offset so we know when to restore it */
20612061
cfi->drap_offset = op->dest.offset;
2062-
}
2063-
2064-
else if (regs[op->src.reg].base == CFI_UNDEFINED) {
2062+
} else {
20652063

20662064
/* drap: mov reg, disp(%rbp) */
20672065
save_reg(cfi, op->src.reg, CFI_BP, op->dest.offset);

0 commit comments

Comments
 (0)