diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2017-02-26 10:38:15 +0100 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2017-05-12 03:47:41 +0200 |
| commit | cd7015c026dc512f9fcc78f38bbb99f57623e329 (patch) | |
| tree | 0a8ebce131475716dd73c2c05f66db53b32c1c3d /validation/alias-same.c | |
| parent | e35efe330c6ae7d154197c29b127560d569016d0 (diff) | |
| download | sparse-dev-cd7015c026dc512f9fcc78f38bbb99f57623e329.tar.gz | |
fix missing reload
In dominates() there is the following comment:
"We don't think two explicitly different symbols ever alias"
but the corresponding test only check if the storage in the
potentialy dominating instruction is a symbol and if so returns 0
meaning that it can't dominate.
But that's without taking in account that a pointer can point
to this symbol and thus that a store via this symbol can dominate
a store via a pointer.
Fix this by changing the test more in accordance to the comment:
return 0 only if the 2 concerned location correspond to 2 *distinct*
symbols (and thus do not return 0 if one of the location is not a symbol).
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation/alias-same.c')
| -rw-r--r-- | validation/alias-same.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/validation/alias-same.c b/validation/alias-same.c new file mode 100644 index 00000000..55cf4244 --- /dev/null +++ b/validation/alias-same.c @@ -0,0 +1,17 @@ +extern int g; + + +static int foo(void) +{ + g = 1; + g = 2; + return g != 1; +} + +/* + * check-name: alias same symbols + * check-command: test-linearize $file + * check-output-ignore + * + * check-output-contains: ret\\..* *\\$1 + */ |
