1/* { dg-do run } */ 2/* { dg-options "-O3" } */ 3 4typedef unsigned int myint __attribute__((aligned(1))); 5 6typedef struct S { 7 unsigned a, b, c; 8} SS; 9 10typedef struct U { 11 SS s[2]; 12} UU; 13 14typedef UU __attribute__((aligned(1))) UUU; 15 16static unsigned int __attribute__ ((noinline)) 17get_a (SS s) 18{ 19 return s.a; 20}; 21 22static int __attribute__ ((noinline, noclone)) 23foo (UUU *p) 24{ 25 int r = (int) get_a(p->s[0]) + 2; 26 return r; 27} 28 29char buf[512]; 30 31static UUU * __attribute__ ((noinline, noclone)) 32get_uuu (void) 33{ 34 return (UUU *)(buf + 1); 35} 36 37int 38main(int argc, char *argv[]) 39{ 40 UUU *p = get_uuu(); 41 if (foo(p) != 2) 42 __builtin_abort (); 43 return 0; 44} 45