| 1 |
/* PR middle-end/117354 */ |
| 2 |
/* { dg-do compile { target bitint } } */ |
| 3 |
/* { dg-options "-O2" } */ |
| 4 |
/* { dg-additional-options "-mavx2" { target x86_64-*-* i?86-*-* } } */ |
| 5 |
|
| 6 |
#if __BITINT_MAXWIDTH__ >= 256 |
| 7 |
#define N 256 |
| 8 |
#else |
| 9 |
#define N 64 |
| 10 |
#endif |
| 11 |
|
| 12 |
struct S { |
| 13 |
unsigned char y; |
| 14 |
_BitInt(N) x; |
| 15 |
} s; |
| 16 |
|
| 17 |
__attribute__((noipa)) static void |
| 18 |
foo (const char *, _BitInt(N)) |
| 19 |
{ |
| 20 |
} |
| 21 |
|
| 22 |
__attribute__((noipa)) static void |
| 23 |
bar (_BitInt(N)) |
| 24 |
{ |
| 25 |
} |
| 26 |
|
| 27 |
static void |
| 28 |
baz (void *p) |
| 29 |
{ |
| 30 |
foo ("bazbazbazb", s.x); |
| 31 |
__builtin_memcpy (p, &s.x, sizeof s.x); |
| 32 |
} |
| 33 |
|
| 34 |
int |
| 35 |
main () |
| 36 |
{ |
| 37 |
void *ptr = &s.x; |
| 38 |
baz (&s.x); |
| 39 |
bar (*(_BitInt(N) *) ptr); |
| 40 |
} |