diff options
author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-12-16 06:18:08 +0100 |
---|---|---|
committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-12-29 14:54:25 +0100 |
commit | f554ff373bfd3914fa68b4983fd8f351840e70d8 (patch) | |
tree | e06b6c647a9fde09cb1d7ca28f16c48ea5937313 | |
parent | 6956d2711272f2781690a79bae5bfa5ca3dada2e (diff) | |
download | sparse-f554ff373bfd3914fa68b4983fd8f351840e70d8.tar.gz |
fix rem_usage()
rem_usage() is used to remove an element from a def-use chain. Optionally,
if the chain become empty, the defining instruction can also be killed.
This optional part is currently be done on all pseudos but only those
having a definition should be concerned.
Fix this by adding a check so that only PSEUDO_REGs and PSEUDO_PHIs are killed.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r-- | simplify.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -271,7 +271,7 @@ static inline void rem_usage(pseudo_t p, pseudo_t *usep, int kill) { if (has_use_list(p)) { delete_pseudo_user_list_entry(&p->users, usep, 1); - if (kill && !p->users) + if (kill && !p->users && has_definition(p)) kill_instruction(p->def); } } |