gcc/testsuite/g++.dg/tree-ssa/pr58404.C
raw| 1 | // { dg-do compile } |
| 2 | // { dg-options "-O -fdump-tree-cddce1" } |
| 3 | |
| 4 | struct S { int s; }; |
| 5 | S a[1024]; |
| 6 | |
| 7 | void |
| 8 | foo () |
| 9 | { |
| 10 | for (int i = 0; i < 1024; i++) |
| 11 | { |
| 12 | S &r = a[i]; |
| 13 | r.s++; |
| 14 | } |
| 15 | } |
| 16 | |
| 17 | // We should propagate the reference into both memory accesses |
| 18 | // during the first forwprop pass |
| 19 | // { dg-final { scan-tree-dump-times "= &a" 0 "cddce1" } } |