1 /* { dg-do compile } */ 2 /* { dg-options "-O2 -Wall" } */ 3 4 typedef int T __attribute__((may_alias)); 5 6 extern T *p; 7 extern int *p; 8 9 extern int *p2; 10 extern T *p2; 11 12 void fn1 (T); 13 void fn1 (int); 14 15 void fn2 (int); 16 void fn2 (T); 17 18 /* Ensure that the composite types have may_alias. */ 19 void f(long * i)20f (long *i) 21 { 22 *i = *(__typeof (*p) *) &p; 23 asm ("" : : "r" (*p)); 24 *i = *(__typeof (*p2) *) &p2; 25 asm ("" : : "r" (*p2)); 26 } 27