example where type based alias analysis helps
authorMatthias Braun <matze@braunis.de>
Sun, 21 Sep 2008 10:49:11 +0000 (10:49 +0000)
committerMatthias Braun <matze@braunis.de>
Sun, 21 Sep 2008 10:49:11 +0000 (10:49 +0000)
[r22141]

ir/be/test/codegen/type_noalias.c [new file with mode: 0644]

diff --git a/ir/be/test/codegen/type_noalias.c b/ir/be/test/codegen/type_noalias.c
new file mode 100644 (file)
index 0000000..18d8b24
--- /dev/null
@@ -0,0 +1,14 @@
+
+struct bar {
+       unsigned int size;
+};
+
+char *foo;
+
+void f(void)
+{
+       foo += 5;
+       ((struct bar*) (foo - 10))->size = 10;
+       ((struct bar*) (foo - 10))->size += 1;
+       ((struct bar*) (foo - 10))->size -= 1;
+}