1 /* PR middle-end/57748 */
2 /* { dg-do run } */
3 /* wrong code in expand_assignment:
4    misalignp == true, !MEM_P (to_rtx),
5    offset == 0, bitpos >= GET_MODE_PRECISION,
6    => result = NULL.  */
7 
8 #include <stdlib.h>
9 
10 extern void abort (void);
11 
12 typedef long long V
13   __attribute__ ((vector_size (2 * sizeof (long long)), may_alias));
14 
15 typedef struct S { V a; V b[0]; } P __attribute__((aligned (1)));
16 
17 struct __attribute__((packed)) T { char c; P s; };
18 
19 void __attribute__((noinline, noclone))
check(struct T * t)20 check (struct T *t)
21 {
22   if (t->s.b[0][0] != 3 || t->s.b[0][1] != 4)
23     abort ();
24 }
25 
26 void __attribute__((noinline, noclone))
foo(P * p)27 foo (P *p)
28 {
29   V a = { 3, 4 };
30   p->b[0] = a;
31 }
32 
33 int
main()34 main ()
35 {
36   struct T *t = (struct T *) calloc (128, 1);
37 
38   foo (&t->s);
39   check (t);
40 
41   free (t);
42   return 0;
43 }
44