summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/20030918-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa/20030918-1.c')
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20030918-1.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030918-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20030918-1.c
new file mode 100644
index 000000000..719ea65f5
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030918-1.c
@@ -0,0 +1,15 @@
+/* The compiler was failing to adjust pointer dereferences into array
+ references after propagating &equot[0] into p. */
+
+/* { dg-do compile } */
+/* { dg-options "-O -ftree-dominator-opts" } */
+
+static unsigned short equot[(6 +3)];
+int
+foo (num)
+ unsigned short num[];
+{
+ unsigned short *p = &equot[0];
+ *p++ = num[0];
+ *p++ = num[1];
+}