Debian Codegraph @

gcc/testsuite/gcc.dg/ipa/remref-5.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O3 -fno-early-inlining -fdump-ipa-cp-details -fdump-tree-optimized" } */
3
4 static double global = 0.0;
5 double foo_temp5;
6
7 static void foo(double *ptr) {
8 static double abcd;
9 double v, exp_res;
10 v = *ptr;
11 exp_res = __builtin_exp(v);
12 foo_temp5 = exp_res * abcd;
13 abcd += foo_temp5;
14 }
15
16 double last_value;
17
18 static void bar(double *ptr)
19 {
20 last_value = *ptr;
21 for (unsigned i = 0; i < 200; i++)
22 foo (ptr);
23 }
24
25 void entry()
26 {
27 bar (&global);
28 }
29
30 void decoy(double *ptr)
31 {
32 bar (ptr);
33 }
34
35
36 /* { dg-final { scan-ipa-dump "Removed a reference" "cp" } } */
37 /* { dg-final { scan-ipa-dump "replaced it with LOAD" "cp" } } */
38 /* { dg-final { scan-tree-dump-times "builtin_exp" 1 "optimized" } } */