| 1 |
/* PR target/114605 */ |
| 2 |
/* { dg-do run } */ |
| 3 |
/* { dg-options "-O0" } */ |
| 4 |
|
| 5 |
typedef struct { const float *a; int b, c; float *d; } S; |
| 6 |
|
| 7 |
__attribute__((noipa)) void |
| 8 |
bar (void) |
| 9 |
{ |
| 10 |
} |
| 11 |
|
| 12 |
__attribute__((noinline, optimize (2))) static void |
| 13 |
foo (S *e) |
| 14 |
{ |
| 15 |
const float *f; |
| 16 |
float *g; |
| 17 |
float h[4] = { 0.0, 0.0, 1.0, 1.0 }; |
| 18 |
if (!e->b) |
| 19 |
f = h; |
| 20 |
else |
| 21 |
f = e->a; |
| 22 |
g = &e->d[0]; |
| 23 |
__builtin_memcpy (g, f, sizeof (float) * 4); |
| 24 |
bar (); |
| 25 |
if (!e->b) |
| 26 |
if (g[0] != 0.0 || g[1] != 0.0 || g[2] != 1.0 || g[3] != 1.0) |
| 27 |
__builtin_abort (); |
| 28 |
} |
| 29 |
|
| 30 |
int |
| 31 |
main () |
| 32 |
{ |
| 33 |
float d[4]; |
| 34 |
S e = { .d = d }; |
| 35 |
foo (&e); |
| 36 |
return 0; |
| 37 |
} |