2 /* { dg-options "-O2 -fipa-pta -fdump-ipa-pta-details -fdump-tree-fre" } */
6 static __attribute__((noinline,noclone)) void
12 static __attribute__((noinline,noclone)) void
13 local_address_taken (int *p)
18 /* Even though not referenced in this TU we should have added constraints
19 for the initializer. */
20 /* { dg-final { scan-ipa-dump "ex = &local_address_taken" "pta" } } */
21 void (*ex)(int *) = local_address_taken;
23 extern void link_error (void);
27 void (*anyfn)(int *) = (void (*)(int *))(__SIZE_TYPE__)x;
28 /* The following should cause local_address_taken to get &x
29 as argument, but not local. We shouldn't get &x added to
30 arbitrary special sub-vars of local_address_taken though,
31 a missed optimization currently.
32 As local_address_taken escapes the translation unit its
33 argument points-to set needs to include ESCAPED and NONLOCAL.
34 We shouldn't get the functions sub-vars in the ESCAPED solution
35 though, another missed-optimization. This also causes the functions
36 uses to be messed up even further. */
37 /* { dg-final { scan-ipa-dump "local_address_taken.arg0 = { ESCAPED NONLOCAL y x }" "pta" } } */
38 /* { dg-final { scan-ipa-dump "local_address_taken.clobber = { ESCAPED NONLOCAL y x }" "pta" } } */
39 /* { dg-final { scan-ipa-dump "local_address_taken.use = { }" "pta" { xfail *-*-* } } } */
43 /* Thus we should be able to disambiguate x against the call to local
44 and CSE the stored value. */
48 local_address_taken (&y);
49 /* As we are computing flow- and context-insensitive we may not
50 CSE the load of x here. */
51 /* { dg-final { scan-tree-dump " = x;" "fre" } } */
55 /* { dg-final { cleanup-ipa-dump "pta" } } */
56 /* { dg-final { cleanup-tree-dump "fre" } } */