Commit f4f80398 authored by Julien Thierry's avatar Julien Thierry Committed by Josh Poimboeuf

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: default avatarJulien Thierry <jthierry@redhat.com>
Signed-off-by: default avatarJosh Poimboeuf <jpoimboe@redhat.com>
parent edea9e6b
...@@ -2030,7 +2030,7 @@ static int update_cfi_state(struct instruction *insn, struct cfi_state *cfi, ...@@ -2030,7 +2030,7 @@ static int update_cfi_state(struct instruction *insn, struct cfi_state *cfi,
/* drap: push %rbp */ /* drap: push %rbp */
cfi->stack_size = 0; cfi->stack_size = 0;
} else if (regs[op->src.reg].base == CFI_UNDEFINED) { } else {
/* drap: push %reg */ /* drap: push %reg */
save_reg(cfi, op->src.reg, CFI_BP, -cfi->stack_size); 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, ...@@ -2059,9 +2059,7 @@ static int update_cfi_state(struct instruction *insn, struct cfi_state *cfi,
/* save drap offset so we know when to restore it */ /* save drap offset so we know when to restore it */
cfi->drap_offset = op->dest.offset; cfi->drap_offset = op->dest.offset;
} } else {
else if (regs[op->src.reg].base == CFI_UNDEFINED) {
/* drap: mov reg, disp(%rbp) */ /* drap: mov reg, disp(%rbp) */
save_reg(cfi, op->src.reg, CFI_BP, op->dest.offset); save_reg(cfi, op->src.reg, CFI_BP, op->dest.offset);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment