diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-02-06 20:15:58 +0100 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-02-14 12:37:21 +0100 |
| commit | 56f6d4dd747ac524e4e93d4aa7a8281e64b416bc (patch) | |
| tree | 53849d086c7f786982716193f2925161027b230a /validation/optim | |
| parent | 154b19b15cecd661b6498fb7683920c5cf8dd938 (diff) | |
| download | sparse-dev-56f6d4dd747ac524e4e93d4aa7a8281e64b416bc.tar.gz | |
fix killing of converted loads
Converted loads are dead and can be removed but that
also means that the address usage need to be adjusted
which wasn't done.
Fix this by directly using kill_instruction().
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation/optim')
| -rw-r--r-- | validation/optim/load-converted.c | 1 | ||||
| -rw-r--r-- | validation/optim/load-semi-volatile.c | 25 |
2 files changed, 25 insertions, 1 deletions
diff --git a/validation/optim/load-converted.c b/validation/optim/load-converted.c index 010c6bc7..7cbb53cf 100644 --- a/validation/optim/load-converted.c +++ b/validation/optim/load-converted.c @@ -8,7 +8,6 @@ static int foo(int *p, int i) /* * check-name: load-converted * check-command: test-linearize -Wno-decl $file - * check-known-to-fail * * check-output-ignore * check-output-excludes: add\. diff --git a/validation/optim/load-semi-volatile.c b/validation/optim/load-semi-volatile.c new file mode 100644 index 00000000..0e266e17 --- /dev/null +++ b/validation/optim/load-semi-volatile.c @@ -0,0 +1,25 @@ +struct s { + volatile int a; +}; + +struct s s; + +void foo(void) +{ + s; + s.a; +} + +/* + * check-name: load-semi-volatile + * check-command: test-linearize -Wno-decl $file + * check-known-to-fail + * + * check-output-ignore + * check-output-pattern(1): load + * + * check-description: + * The load at line 9 must be removed. + * The load at line 10 is volatile and thus + * must not be removed. + */ |
