re PR middle-end/47917 (snprintf(..., "const string") should be optimized into memcpy)
authorJakub Jelinek <jakub@redhat.com>
Mon, 14 Mar 2011 20:30:24 +0000 (21:30 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 14 Mar 2011 20:30:24 +0000 (21:30 +0100)
commitba3ceb2dd2f3a8f15b21bdf7ea035d9ec9c806f5
tree123d933dc08e81d842d0ad90b7fab6a8cced05a9
parentd63c53cce2d137062e4f93a9ff410e684bc7bc1b
re PR middle-end/47917 (snprintf(..., "const string") should be optimized into memcpy)

PR middle-end/47917
* builtins.c (fold_builtin_snprintf): New function.
(fold_builtin_3): Call it for BUILT_IN_SNPRINTF.
(fold_builtin_4): Likewise.

* gcc.c-torture/execute/pr47917.c: New test.
* gcc.dg/pr47917.c: New test.

From-SVN: r170959
gcc/ChangeLog
gcc/builtins.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/pr47917.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/pr47917.c [new file with mode: 0644]