Debian Codegraph @

gcc/testsuite/gcc.dg/lto/alias-access-path-2_0.c

raw
1 /* { dg-lto-do run } */
2 /* { dg-lto-options { { -O3 -flto -fno-early-inlining } } } */
3
4 /* In this test the access patch orracle (aliasing_component_refs_p)
5 can disambiguage array[0] from array[1] by base+offset but it needs to be
6 able to find the common type and not give up by not being able to compare
7 types earlier. */
8
9 typedef int (*fnptr) ();
10
11 __attribute__ ((used))
12 struct a
13 {
14 void *array[2];
15 } a, *aptr = &a;
16
17 __attribute__ ((used))
18 struct b
19 {
20 struct a a;
21 } *bptr;
22
23 static void
24 inline_me_late (int argc)
25 {
26 if (argc == -1)
27 bptr->a.array[1] = bptr;
28 }
29
30 int
31 main (int argc)
32 {
33 aptr->array[0] = 0;
34 inline_me_late (argc);
35 if (!__builtin_constant_p (aptr->array[0] == 0))
36 __builtin_abort ();
37 return 0;
38 }