1/* { dg-do compile } */ 2/* { dg-options "-fdump-tree-gimple" } */ 3 4struct f 5{ 6 struct { 7 int i; 8 } ff[10]; 9}; 10 11struct f g; 12int 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" 5 "gimple" } } */ 23/* { dg-final { scan-tree-dump-times "int D\\\." 1 "gimple" } } */ 24/* { dg-final { cleanup-tree-dump "gimple" } } */ 25