]> gcc.gnu.org Git - gcc.git/commit
builtins.c (expand_builtin_sprintf): Use c_getstr and strlen to obtain the format...
authorRoger Sayle <roger@eyesopen.com>
Fri, 27 Jun 2003 02:50:19 +0000 (02:50 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Fri, 27 Jun 2003 02:50:19 +0000 (02:50 +0000)
commit6ba701c8e99bcf81604a3bf9f69544434edd239e
tree0c737ba12698215611e4c39ae5f14fff744af169
parent34cd7ff69817204455c822307f764338e7a97e48
builtins.c (expand_builtin_sprintf): Use c_getstr and strlen to obtain the format string instead of using...

* builtins.c (expand_builtin_sprintf): Use c_getstr and strlen to
obtain the format string instead of using TREE_STRING_POINTER and
TREE_STRING_LENGTH.  Only optimize sprintf(dst,"%s",src) when the
return value is unused or the length of src is a known constant.

* gcc.c-torture/execute/string-opt-16.c: Remove test for disabled
sprintf(dst,"%s",src) optimization.
* gcc.c-torture/execute/20030626-1.c: New test case.
* gcc.c-torture/execute/20030626-2.c: New test case.

Co-Authored-By: Jakub Jelinek <jakub@redhat.com>
From-SVN: r68555
gcc/ChangeLog
gcc/builtins.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/20030626-1.c [new file with mode: 0644]
gcc/testsuite/gcc.c-torture/execute/20030626-2.c [new file with mode: 0644]
gcc/testsuite/gcc.c-torture/execute/string-opt-16.c
This page took 0.062692 seconds and 5 git commands to generate.