gcc/testsuite/gcc.target/riscv/rvv/base/bug-6.c
raw| 1 | /* Test that we do not have ice when compile */ |
| 2 | /* { dg-do compile } */ |
| 3 | /* { dg-options "-march=rv64gcv -mabi=lp64d -O3 -ftree-vectorize" } */ |
| 4 | |
| 5 | struct A { float x, y; }; |
| 6 | struct B { struct A u; }; |
| 7 | |
| 8 | extern void bar (struct A *); |
| 9 | |
| 10 | float |
| 11 | f3 (struct B *x, int y) |
| 12 | { |
| 13 | struct A p = {1.0f, 2.0f}; |
| 14 | struct A *q = &x[y].u; |
| 15 | |
| 16 | __builtin_memcpy (&q->x, &p.x, sizeof (float)); |
| 17 | __builtin_memcpy (&q->y, &p.y, sizeof (float)); |
| 18 | |
| 19 | bar (&p); |
| 20 | |
| 21 | return x[y].u.x + x[y].u.y; |
| 22 | } |