1 2 3 4 5 6 7 8 9 10 11 12 13
/* { dg-do compile } */ /* { dg-options "-O2 -fdump-tree-pre-stats" } */ struct { int x; int y; } global; void foo(int n) { int i; for ( i=0; i<n; i++) global.y += global.x*global.x; } /* { dg-final { scan-tree-dump "Eliminated: 3" "pre" } } */ /* { dg-final { cleanup-tree-dump "pre" } } */