builtins.c (c_strlen): Handle not zero terminated STRING_CSTs correctly.
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Fri, 14 Sep 2018 01:49:38 +0000 (01:49 +0000)
committerJeff Law <law@gcc.gnu.org>
Fri, 14 Sep 2018 01:49:38 +0000 (19:49 -0600)
commitd01b568a78351beb6b693b613e6b48bcb2475eae
treebd7da348cd6459bb6656e42300e83dcf9f2ac2c2
parent9a9f692b6c0c8b93b7fda00c60c6e30c2e6551ce
builtins.c (c_strlen): Handle not zero terminated STRING_CSTs correctly.

* builtins.c (c_strlen): Handle not zero terminated STRING_CSTs
correctly.
* fold-const.c (c_getstr): Fix function comment.  Remove unused third
argument.  Fix range checks.
* fold-const.h (c_getstr): Adjust protoype.
* gimple-fold.c (gimple_fold_builtin_memory_op): Avoid folding when
string is constant but contains no NUL byte.

From-SVN: r264301
gcc/ChangeLog
gcc/builtins.c
gcc/fold-const.c
gcc/fold-const.h
gcc/gimple-fold.c