PR ipa/61602
[official-gcc.git] / gcc / testsuite / gcc.dg / torture / pr57748-2.c
blob4e3b4b88468cd6f4712811999c3d8e15ccdd3ec1
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. */
8 #include <stdlib.h>
10 extern void abort (void);
12 typedef long long V
13 __attribute__ ((vector_size (2 * sizeof (long long)), may_alias));
15 typedef struct S { V a; V b[0]; } P __attribute__((aligned (1)));
17 struct __attribute__((packed)) T { char c; P s; };
19 void __attribute__((noinline, noclone))
20 check (struct T *t)
22 if (t->s.b[0][0] != 3 || t->s.b[0][1] != 4)
23 abort ();
26 void __attribute__((noinline, noclone))
27 foo (P *p)
29 V a = { 3, 4 };
30 p->b[0] = a;
33 int
34 main ()
36 struct T *t = (struct T *) calloc (128, 1);
38 foo (&t->s);
39 check (t);
41 free (t);
42 return 0;