gcc/testsuite/gcc.dg/tree-ssa/pr23401.c
raw| 1 | /* { dg-do compile } */ |
| 2 | /* { dg-options "-fdump-tree-gimple" } */ |
| 3 | |
| 4 | struct f |
| 5 | { |
| 6 | struct { |
| 7 | int i; |
| 8 | } ff[10]; |
| 9 | }; |
| 10 | |
| 11 | struct f g; |
| 12 | int ffff(int i) |
| 13 | { |
| 14 | int t1 = 0; |
| 15 | int i1 = g.ff[t1].i; |
| 16 | int i2 = g.ff[i].i; |
| 17 | return i1 + i2; |
| 18 | } |
| 19 | |
| 20 | /* We should not use extra temporaries apart from for i1 + i2. */ |
| 21 | |
| 22 | /* { dg-final { scan-tree-dump-times "int" 6 "gimple" } } */ |
| 23 | /* { dg-final { scan-tree-dump-times "int D\\\." 1 "gimple" } } */ |