OSDN Git Service

2010-01-26 Richard Guenther <rguenther@suse.de>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / tree-ssa / pr31146.C
1 /* { dg-do compile } */
2 /* { dg-options "-O -fdump-tree-forwprop" } */
3
4 /* We should be able to optimize this to i[j] = 1 during
5    early optimizations.  */
6
7 int i[5];
8 void foo (int j)
9 {
10   void *p = &i[j];
11   int *q = (int *)p;
12   *q = 1;
13 }
14
15 /* { dg-final { scan-tree-dump "i\\\[j.*\\\] =.* 1;" "forwprop1" } } */
16 /* { dg-final { cleanup-tree-dump "forwprop?" } } */