OSDN Git Service

PR middle-end/23484
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 29 Aug 2005 08:40:48 +0000 (08:40 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 29 Aug 2005 08:40:48 +0000 (08:40 +0000)
commitad89623c1a5016fe2ca11a6c3765f61020ecc76f
tree3b05ddc14a41f4ae6ef2054dd356f6df933d296e
parent6d194412055678385ba81234a60fc79b9d680d62
PR middle-end/23484
* builtins.c (fold_builtin_memory_chk, fold_builtin_stxcpy_chk,
fold_builtin_strncpy_chk, fold_builtin_snprintf_chk): If len is
not constant, but maxlen is, don't set len to maxlen, rather
set maxlen to len if len is a constant.

* gcc.c-torture/execute/builtins/pr23484-chk.c: New test.
* gcc.c-torture/execute/builtins/pr23484-chk-lib.c: New file.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@103594 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/builtins.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/builtins/pr23484-chk-lib.c [new file with mode: 0644]
gcc/testsuite/gcc.c-torture/execute/builtins/pr23484-chk.c [new file with mode: 0644]