Debian Codegraph @

gcc/testsuite/gcc.dg/tree-ssa/strncpy-1.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O -fdump-tree-optimized" } */
3
4 void sink (void*);
5
6 void f (const char *s)
7 {
8 char a[256];
9
10 __builtin_memset (a, 0, sizeof a); // redundant memset
11 __builtin_strncpy (a, s, sizeof a);
12
13 sink (a);
14 }
15
16 /* { dg-final { scan-tree-dump-not "memset" "optimized" } } */