aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/optim/volatile-bitfield.c
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-08-09 17:53:18 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-08-25 21:04:11 +0200
commitcf773f6cf67c88731a77be96245b2a1600de94ff (patch)
tree2446b5aadb235ac5c9eb3f3d4408da7c43c7f156 /validation/optim/volatile-bitfield.c
parent418aa1fe4bd938f9028ef1f2a71bea56aa9ab3ad (diff)
downloadsparse-dev-cf773f6cf67c88731a77be96245b2a1600de94ff.tar.gz
fix: do not optimize away accesses to volatile bitfields
Accesses to volatiles must, of course, not be optimized away. For this, we need to check to type associated to the memory access. Currently this is done by checking if the type of the result of the memops is volatile or not. Usualy, the type of the result is the same as the one of the access so everything is good but for bitfields, the memop is not done with the type of the bitfield itself but to its base type. Since this base type is unrelated to the access type, it is generaly not marked as volatile even when the access to the bitfield is volatile. Fix this by using the true type of the access to set the field struct instruction::is_volatile. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation/optim/volatile-bitfield.c')
-rw-r--r--validation/optim/volatile-bitfield.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/validation/optim/volatile-bitfield.c b/validation/optim/volatile-bitfield.c
index c28efb09..99db4401 100644
--- a/validation/optim/volatile-bitfield.c
+++ b/validation/optim/volatile-bitfield.c
@@ -10,7 +10,6 @@ void foo(volatile struct s *p)
/*
* check-name: volatile-bitfield
* check-command: test-linearize -Wno-decl $file
- * check-known-to-fail
*
* check-output-ignore
* check-output-contains: load\\.