111
|
1 /* PR tree-optimization/64715 */
|
|
2 /* { dg-do compile } */
|
|
3 /* { dg-options "-O2 -fdump-tree-optimized" } */
|
|
4
|
|
5 extern inline __attribute__ ((always_inline, gnu_inline, artificial, nothrow, leaf)) char *
|
|
6 strcpy (char *__restrict dest, const char *__restrict src)
|
|
7 {
|
|
8 return __builtin___strcpy_chk (dest, src, __builtin_object_size (dest, 2 > 1));
|
|
9 }
|
|
10
|
|
11 const char *str1 = "JIHGFEDCBA";
|
|
12 void bar (char *);
|
|
13
|
|
14 void
|
|
15 foo ()
|
|
16 {
|
|
17 struct A { char buf1[9]; char buf2[1]; } a;
|
|
18 strcpy (a.buf1 + (0 + 4), str1 + 5);
|
|
19 bar ((char *) &a);
|
|
20 }
|
|
21
|
|
22 /* { dg-final { scan-tree-dump "__builtin___strcpy_chk\[^;\n\r\]*, 5\\\);" "optimized" } } */
|