Daily bump.
[official-gcc.git] / gcc / testsuite / gcc.dg / builtin-memcpy-2.c
blobbddff935fc4c164e5864cc9842daa3525280a432
1 /* PR tree-optimization/88800 - Spurious -Werror=array-bounds for non-taken
2 branch
3 Verify that out-of-bounds memcpy calls are not folded even when
4 warnings are disabled.
5 { dg-do compile }
6 { dg-options "-O2 -w -fdump-tree-optimized" } */
8 extern void* memcpy (void*, const void*, __SIZE_TYPE__);
10 char a1[1], a2[2], a4[4], a8[8], a16[16], a32[32];
12 void f1 (const void *p)
14 memcpy (a1, p, sizeof a1 * 2);
17 void f2 (const void *p)
19 memcpy (a2, p, sizeof a2 * 2);
22 void f4 (const void *p)
24 memcpy (a4, p, sizeof a4 * 2);
27 void f8 (const void *p)
29 memcpy (a8, p, sizeof a8 * 2);
32 void f16 (const void *p)
34 memcpy (a16, p, sizeof a16 * 2);
37 void f32 (const void *p)
39 memcpy (a32, p, sizeof a32 * 2);
42 /* { dg-final { scan-tree-dump-times "memcpy" 6 "optimized" } } */