diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2017-06-16 19:28:08 +0200 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2017-11-10 18:13:08 +0100 |
| commit | a2011cb2a0a5c72fc2f09e123f38649cbe34c570 (patch) | |
| tree | e2aa9c37cc83233d59eaec86235b185d563dc360 /flow.c | |
| parent | 937d0e545ff0ea703be2062dcf3f3ab717183ac7 (diff) | |
| download | sparse-dev-a2011cb2a0a5c72fc2f09e123f38649cbe34c570.tar.gz | |
volatile loads are side-effects too
Some branch simplifications are only valid if the branch is free
of side-effects. The check is done in flow.c:bb_has_side_effects()
but currently deosn't take in account the fact that a volatile load
is also a side-effect.
Fix this by adding the appropriate check.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'flow.c')
| -rw-r--r-- | flow.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -169,6 +169,13 @@ static int bb_has_side_effects(struct basic_block *bb) /* FIXME! This should take "const" etc into account */ return 1; + case OP_LOAD: + if (!insn->type) + return 1; + if (insn->type->ctype.modifiers & MOD_VOLATILE) + return 1; + continue; + case OP_STORE: case OP_CONTEXT: return 1; |
