Commit 1b1a1881 by Martin Sebor Committed by Martin Sebor

PR tree-optimization/83519 - missing -Wrestrict on an overlapping strcpy to a non-member array

gcc/testsuite/ChangeLog:

	* gcc.dg/Wrestrict-13.c: New test.

From-SVN: r258348
parent 00df7c36
2018-03-07 Martin Sebor <msebor@redhat.com>
PR tree-optimization/83519
* gcc.dg/Wrestrict-13.c: New test.
2018-03-07 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/64124
......@@ -12,6 +17,11 @@
2018-03-07 Martin Sebor <msebor@redhat.com>
PR tree-optimization/84526
* gcc.dg/Wrestrict-10.c: New test.
2018-03-07 Martin Sebor <msebor@redhat.com>
PR tree-optimization/84468
* g++.dg/warn/Wstringop-truncation-2.C: New test.
* gcc.dg/Wstringop-truncation.c: New test.
......
/* PR tree-optimization/83519 - missing -Wrestrict on an overlapping
strcpy to a non-member array
{ dg-do compile }
{ dg-options "-O2 -Wall -Wrestrict" } */
extern char* stpcpy (char*, const char*); // work around bug 82429
struct S { char a[17]; };
void f (struct S *p, const char *s)
{
__builtin_strcpy (p->a, "0123456789abcdef");
__builtin_strcpy (p->a, p->a + 4); /* { dg-warning "\\\[-Wrestrict]" } */
}
char a[17];
void g (const char *s)
{
__builtin_strcpy (a, "0123456789abcdef");
__builtin_strcpy (a, a + 4); /* { dg-warning "\\\[-Wrestrict]" } */
}
void h (const char *s)
{
char a[17];
__builtin_strcpy (a, "0123456789abcdef");
__builtin_strcpy (a, a + 4); /* { dg-warning "\\\[-Wrestrict]" } */
extern void sink (void*);
sink (a);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment