1 /* PR rtl-optimization/71532 */
2 /* { dg-do run } */
3 /* { dg-additional-options "-mtune=slm" { target i?86-*-* x86_64-*-* } } */
4
5 __attribute__((noinline, noclone, pure)) int
foo(int a,int b,int c,int d,int e,int f,int g,int h,int i,int j,int k,int l)6 foo (int a, int b, int c, int d, int e, int f, int g, int h, int i, int j, int k, int l)
7 {
8 a++; b++; c++; d++; e++; f++; g++; h++; i++; j++; k++; l++;
9 asm volatile ("" : : "g" (&a), "g" (&b), "g" (&c), "g" (&d) : "memory");
10 asm volatile ("" : : "g" (&e), "g" (&f), "g" (&g), "g" (&h) : "memory");
11 asm volatile ("" : : "g" (&i), "g" (&j), "g" (&k), "g" (&l) : "memory");
12 return a + b + c + d + e + f + g + h + i + j + k + l;
13 }
14
15 __attribute__((noinline, noclone, pure)) int
bar(int a,int b,int c,int d,int e,int f,int g,int h,int i,int j,int k,int l)16 bar (int a, int b, int c, int d, int e, int f, int g, int h, int i, int j, int k, int l)
17 {
18 a++; b++; c++; d++; e++; f++; g++; h++; i++; j++; k++; l++;
19 asm volatile ("" : : "g" (&a), "g" (&b), "g" (&c), "g" (&d) : "memory");
20 asm volatile ("" : : "g" (&e), "g" (&f), "g" (&g), "g" (&h) : "memory");
21 asm volatile ("" : : "g" (&i), "g" (&j), "g" (&k), "g" (&l) : "memory");
22 return 2 * a + b + c + d + e + f + g + h + i + j + k + l;
23 }
24
25 __attribute__((noinline, noclone)) int
test()26 test ()
27 {
28 int a = foo (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
29 a += bar (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
30 return a;
31 }
32
33 int
main()34 main ()
35 {
36 if (test () != 182)
37 __builtin_abort ();
38 return 0;
39 }
40