Example 8: An example to illustrate assembly level alias analysis (source C code) #include void foo(int **x, int **y) { *x = malloc(sizeof(int)); **x = 2; *y = *x; return; } int a = 0, b = 1; void main(void) { int *p,*q,*r; int t[10]; /* temperal variable */ p = &a; q = &b; r = p; /* before foo(): p and r point to the same memory location */ foo(&p, &q); /* after foo(): p and q point to the same memory location */ /* test RAR and common sub-expression elimination */ t[0] = *p; t[1] = *q; t[2] = *r; t[3] = *p; /* test WAR */ *p = 10; /* test RAW */ t[4] = *p; t[5] = *q; t[6] = *r; /* test WAW */ *p = 11; *q = 12; *r = 13; return; }