PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / struct-aliasing-2.c
blob3a78c2c1711fdb16274849307f6a2394fe9d431d
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-cddce1" } */
4 struct S { unsigned f; };
6 int
7 foo ( struct S *p)
9 int *q = (int *)&p->f;
10 int i = *q;
11 return i + p->f;
15 /* There should only be one load of p->f because FRE removes the redundancy
16 by realizing it can cast the result of either to the other. */
17 /* { dg-final { scan-tree-dump-times "= \[^\n\]*p_.\\\(D\\\)" 1 "cddce1" } } */