aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linearize.c
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-08-09 18:14:20 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-08-25 21:04:11 +0200
commit418aa1fe4bd938f9028ef1f2a71bea56aa9ab3ad (patch)
tree5cc3e683665d7ba06f13be2bd3edc5dca1ef7ed6 /linearize.c
parentff47e3b34d9bb18d32018e1e0bb1fe977d48c0e3 (diff)
downloadsparse-dev-418aa1fe4bd938f9028ef1f2a71bea56aa9ab3ad.tar.gz
add a flag for volatile memops
When simplifying memops, it's needed to check if the memops is a volatile access or not. This is currently done by checking insn->type->ctype.modifiers & MOD_VOLATILE which is rather long but also incorrect for bitfields. Prepare to fix this by adding a flag to struct instruction directly telling if the access is volatile. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'linearize.c')
-rw-r--r--linearize.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/linearize.c b/linearize.c
index a56c272f..fc4c4271 100644
--- a/linearize.c
+++ b/linearize.c
@@ -991,6 +991,7 @@ static pseudo_t add_load(struct entrypoint *ep, struct access_data *ad)
insn->target = new;
insn->offset = ad->offset;
+ insn->is_volatile = insn->type && (insn->type->ctype.modifiers & MOD_VOLATILE);
use_pseudo(insn, ad->address, &insn->src);
add_one_insn(ep, insn);
return new;
@@ -1006,6 +1007,7 @@ static void add_store(struct entrypoint *ep, struct access_data *ad, pseudo_t va
store = alloc_typed_instruction(OP_STORE, ad->btype);
store->offset = ad->offset;
+ store->is_volatile = store->type && (store->type->ctype.modifiers & MOD_VOLATILE);
use_pseudo(store, value, &store->target);
use_pseudo(store, ad->address, &store->src);
add_one_insn(ep, store);