aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/optim/volatile-bitfield.c
AgeCommit message (Collapse)AuthorFilesLines
2018-08-25fix: do not optimize away accesses to volatile bitfieldsLuc Van Oostenryck1-1/+0
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>
2018-08-25add testcase for accesses to volatile bitfieldsLuc Van Oostenryck1-0/+17
Accesses to bitfields must, of course, not be optimized away. This is currently not the case. Add a testcase for it. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>