1 /* PR debug/42801 */ 2 /* { dg-do run } */ 3 /* { dg-options "-g" } */ 4 5 void __attribute__((noinline)) fn1(int * x,int y)6fn1 (int *x, int y) 7 { 8 asm volatile ("" : : "rm" (x), "rm" (y) : "memory"); 9 } 10 11 static inline __attribute__((always_inline)) int fn2(int i)12fn2 (int i) 13 { 14 int a[i]; 15 fn1 (a, i); 16 fn1 (a, i); /* { dg-final { gdb-test 16 "sizeof (a)" "5 * sizeof (int)" } } */ 17 return i; 18 } 19 20 static inline __attribute__((always_inline)) int fn3(int i)21fn3 (int i) 22 { 23 int a[i]; 24 fn1 (a, i); 25 fn1 (a, i); /* { dg-final { gdb-test 25 "sizeof (a)" "6 * sizeof (int)" } } */ 26 return i; 27 } 28 29 static inline __attribute__((always_inline)) int fn4(int i)30fn4 (int i) 31 { 32 return fn3 (i); 33 } 34 35 int __attribute__((noinline)) fn5(void)36fn5 (void) 37 { 38 return fn2 (5) + 1; 39 } 40 41 int __attribute__((noinline)) fn6(int i)42fn6 (int i) 43 { 44 return fn2 (i + 1) + fn4 (i + 2) + fn4 (i + 2) + 1; 45 } 46 47 int main(void)48main (void) 49 { 50 int x = 4; 51 asm volatile ("" : "+r" (x)); 52 fn5 (); 53 fn6 (x); 54 return 0; 55 } 56