re PR tree-optimization/33593 (tree-outof-ssa moves sources of non-call exceptions...
[gcc.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" { xfail *-*-* } } } */
16 /* { dg-final { scan-tree-dump "i\\\[j.*\\\] = 1;" "forwprop2" } } */
17 /* { dg-final { cleanup-tree-dump "forwprop?" } } */