1 /* PR tree-optimization/83446 - Bootstrap failed on i686
2 { dg-do compile }
3 { dg-options "-O2 -Warray-bounds" } */
4
5 char a[4];
6
f0i(void * d,int n)7 void f0i (void *d, int n)
8 {
9 if (n < 0) n = 0;
10
11 __builtin_memcpy (d, a + sizeof a - n, n);
12 }
13
f0L(void * d,long n)14 void f0L (void *d, long n)
15 {
16 if (n < 0) n = 0;
17
18 __builtin_memcpy (d, a + sizeof a - n, n);
19 }
20
f0u(void * d,unsigned n)21 void f0u (void *d, unsigned n)
22 {
23 if (n < 0) n = 1;
24
25 __builtin_memcpy (d, a + sizeof a - n, n); /* { dg-bogus "\\\[-Warray-bounds" } */
26 }
27
f1lu(void * d,unsigned long n)28 void f1lu (void *d, unsigned long n)
29 {
30 if (n < 1) n = 1;
31
32 __builtin_memcpy (d, a + sizeof a - n, n); /* { dg-bogus "\\\[-Warray-bounds" } */
33 }
34