Debian Codegraph @

gcc/testsuite/gcc.c-torture/execute/20030828-2.c

raw
1 void abort (void);
2 void exit (int);
3
4 struct rtx_def
5 {
6 int code;
7 };
8
9 int
10 main(void)
11 {
12 int tmp[2];
13 struct rtx_def *r, s;
14 int *p, *q;
15
16 /* The alias analyzer was creating the same memory tag for r, p and q
17 because 'struct rtx_def *' is type-compatible with 'int *'. However,
18 the alias set of 'int[2]' is not the same as 'int *', so variable
19 'tmp' was deemed not aliased with anything. */
20 r = &s;
21 r->code = 39;
22
23 /* If 'r' wasn't declared, then q and tmp would have had the same memory
24 tag. */
25 p = tmp;
26 q = p + 1;
27 *q = 0;
28 tmp[1] = 39;
29 if (*q != 39)
30 abort ();
31 exit (0);
32 }