3 /* { dg-options "-Os" } */
4 /* { dg-additional-options "-mpreferred-stack-boundary=2" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
6 struct S { int s; unsigned long t; };
8 __attribute__ ((noinline, noclone)) unsigned long long
9 bar (struct S *x, unsigned long y)
11 asm volatile ("" : : "r" (x), "r" (y) : "memory");
15 __attribute__ ((noinline, noclone)) unsigned long long
16 foo (struct S *x, unsigned long y)
19 if (__builtin_expect (((__UINTPTR_TYPE__) (x) + 0x1000U < 0x2000U), 0))
21 if (__builtin_expect (x->s <= 0 || x->s > 9, 0))
27 return x->t + y * 4096;
37 asm volatile ("" : : : "memory");
38 int a = va, b = vb, c = vc, d = vd;
39 asm volatile ("" : : : "memory");
41 for (i = 0; i < 64; i++)
42 if (foo ((struct S *) 0, 0) != ~0ULL)
46 if (foo (&s, 2) != ~0ULL)
48 if (foo (&s, 3) != (2 << 12) + 3 * 4096)
50 asm volatile ("" : : : "memory");
51 va = a; vb = b; vc = c; vd = d;
52 asm volatile ("" : : : "memory");