aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/memops.c
diff options
context:
space:
mode:
Diffstat (limited to 'memops.c')
-rw-r--r--memops.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/memops.c b/memops.c
index 44d90754..f734f6eb 100644
--- a/memops.c
+++ b/memops.c
@@ -213,6 +213,11 @@ static bool try_to_kill_store(pseudo_t pseudo, struct instruction *insn,
/* possible partial dominance? */
if (dominance < 0)
return false;
+ if (insn->target == dom->target && insn->bb == dom->bb) {
+ // found a memop which makes the store redundant
+ kill_instruction_force(insn);
+ return false;
+ }
if (dom->opcode == OP_LOAD)
return false;
if (dom->is_volatile)