PR tree-optimization/85826 - ICE in gimple-ssa-warn-restruct on
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / loadpre5.c
blob22c8a18e6c3e5044a99d4c202acd0186f7fd4c3c
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-pre-stats" } */
3 int p;
4 int r;
6 __attribute__ ((noinline))
7 static int a(void)
9 return p;
11 int foo(int argc)
13 int q;
14 q = a();
16 /* We should be able to move the call to a into the if path.
17 in a perfect world, we'd actually decide that it can't touch
18 r, and not recompute it at all!. */
19 if (argc)
20 r = 9;
21 return q + a();
23 /* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "pre"} } */