]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.dg/tree-ssa/forwprop-2.c
re PR middle-end/42834 (memcpy folding overeager)
[thirdparty/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-times "t\\\[i.*\\\].* = 1;" 1 "forwprop1" } } */
21 /* { dg-final { cleanup-tree-dump "forwprop?" } } */