2 /* { dg-options "-O2 -fipa-pta -fdump-ipa-pta2-details -fdump-tree-fre3 -fno-ipa-icf -fno-ipa-modref" } */
6 static __attribute__((noinline
,noclone
)) void
12 static __attribute__((noinline
,noclone
)) void
13 local_address_taken (int *p
)
20 /* Even though not referenced in this TU we should have added constraints
21 for the initializer. */
22 /* { dg-final { scan-ipa-dump "ex = &local_address_taken" "pta2" } } */
23 void (*ex
)(int *) = local_address_taken
;
25 extern void link_error (void);
29 void (*anyfn
)(int *) = (void (*)(int *))(__SIZE_TYPE__
)anyfn_global
;
30 /* The following should cause local_address_taken to get &x
31 as argument, but not local. We shouldn't get &x added to
32 arbitrary special sub-vars of local_address_taken though,
33 a missed optimization currently.
34 As local_address_taken escapes the translation unit its
35 argument points-to set needs to include ESCAPED and NONLOCAL.
36 We shouldn't get the functions sub-vars in the ESCAPED solution
37 though, another missed-optimization. This also causes the functions
38 uses to be messed up even further. */
39 /* ??? As we don't expand the ESCAPED solution we either get x printed here
40 or not based on the phase of the moon. */
41 /* { dg-final { scan-ipa-dump "local_address_taken.arg0 = { ESCAPED NONLOCAL y x }" "pta2" { xfail *-*-* } } } */
42 /* { dg-final { scan-ipa-dump "local_address_taken.clobber = { ESCAPED NONLOCAL y x }" "pta2" { xfail *-*-* } } } */
43 /* { dg-final { scan-ipa-dump "local_address_taken.use = { }" "pta2" { xfail *-*-* } } } */
44 /* ??? But make sure x really escaped. */
45 /* { dg-final { scan-ipa-dump "ESCAPED = {\[^\n\}\]* x \[^\n\}\]*}" "pta2" } } */
49 /* Thus we should be able to disambiguate x against the call to local
50 and CSE the stored value. */
54 local_address_taken (&y
);
55 /* As we are computing flow- and context-insensitive we may not
56 CSE the load of x here. */
57 /* { dg-final { scan-tree-dump " = x;" "fre3" } } */