annotate gcc/testsuite/gcc.dg/pr29215.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* PR middle-end/29215 */
kono
parents:
diff changeset
2 /* { dg-do compile } */
kono
parents:
diff changeset
3 /* { dg-options "-O2 -fdump-tree-ccp1" } */
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5 char buf[5 * sizeof (int) + 1] __attribute__((aligned (__alignof__ (int))));
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 static void
kono
parents:
diff changeset
8 foo (int arg1, int arg2, int arg3, int arg4, int arg5)
kono
parents:
diff changeset
9 {
kono
parents:
diff changeset
10 __builtin_memcpy (buf, &arg1, sizeof (int));
kono
parents:
diff changeset
11 __builtin_memcpy (buf + sizeof (int), &arg2, sizeof (int));
kono
parents:
diff changeset
12 __builtin_memcpy (buf + 2 * sizeof (int), &arg3, sizeof (int));
kono
parents:
diff changeset
13 __builtin_memcpy (buf + 3 * sizeof (int), &arg4, sizeof (int));
kono
parents:
diff changeset
14 __builtin_memcpy (buf + 4 * sizeof (int), &arg5, sizeof (int));
kono
parents:
diff changeset
15 }
kono
parents:
diff changeset
16
kono
parents:
diff changeset
17 int
kono
parents:
diff changeset
18 main (void)
kono
parents:
diff changeset
19 {
kono
parents:
diff changeset
20 union { char buf[4]; int i; } u;
kono
parents:
diff changeset
21 u.i = 0;
kono
parents:
diff changeset
22 u.buf[0] = 'a';
kono
parents:
diff changeset
23 u.buf[1] = 'b';
kono
parents:
diff changeset
24 u.buf[2] = 'c';
kono
parents:
diff changeset
25 u.buf[3] = 'd';
kono
parents:
diff changeset
26 foo (u.i, u.i, u.i, u.i, u.i);
kono
parents:
diff changeset
27 buf[5 * sizeof (int)] = '\0';
kono
parents:
diff changeset
28 __builtin_puts (buf);
kono
parents:
diff changeset
29 return 0;
kono
parents:
diff changeset
30 }
kono
parents:
diff changeset
31
kono
parents:
diff changeset
32 /* { dg-final { scan-tree-dump-not "memcpy" "ccp1" } } */