1 /* PR tree-optimization/86196 - Bogus -Wrestrict on memcpy between array
2 elements at unequal indices
4 { dg-options "-O2 -Wall" } */
6 typedef __SIZE_TYPE__
size_t;
8 extern void* memcpy (void*, const void*, size_t);
16 /* Test case submitted in the PR. */
18 void pr86196_c0 (struct S
* a
, size_t n
)
20 for (size_t i
= 0, j
= 0; i
!= n
; ++i
)
25 memcpy (&a
[j
], &a
[i
], sizeof (struct S
)); /* { dg-bogus "\\\[-Wrestrict" } */
31 /* Reduced test case. */
33 void pr86196_c1 (struct S
*a
, int i
, int j
)
36 memcpy (&a
[j
], &a
[i
], sizeof (struct S
)); /* { dg-bogus "\\\[-Wrestrict" } */