re PR tree-optimization/33291 (a+=2; a+=2 not simplified to a+=4; with -O3 ...
[gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / forwprop-2.c
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-forwprop1" } */
3
4 /* We should be able to optimize this to b->t[i] = 1 during
5 early optimizations. */
6
7 struct a
8 {
9 char t[10];
10 };
11
12 struct a *b;
13
14 void f(__SIZE_TYPE__ i)
15 {
16 char *c = b->t;
17 c[i] = 1;
18 }
19
20 /* { dg-final { scan-tree-dump "t\\\[i.*\\\] = 1;" "forwprop1" } } */
21 /* { dg-final { cleanup-tree-dump "forwprop?" } } */