re PR tree-optimization/89772 (memchr for a character not in constant nul-padded...
authorJun Ma <JunMa@linux.alibaba.com>
Thu, 27 Jun 2019 09:50:35 +0000 (09:50 +0000)
committerJun Ma <junma@gcc.gnu.org>
Thu, 27 Jun 2019 09:50:35 +0000 (09:50 +0000)
commit5fd336bbd7b273408018dfbb7a170e1d54facb8e
tree22f6406d9cbec125a110e719d1d92089c273176e
parente11c48711128a8aff3938cf28954acf1b1cc0b62
re PR tree-optimization/89772 (memchr for a character not in constant nul-padded string not folded)

PR tree-optimization/89772
* gimple-fold.c (gimple_fold_builtin_memchr): consider trailing nuls in
out-of-bound accesses checking.

gcc/testsuite
* gcc.dg/builtin-memchr-4.c: New test.

From-SVN: r272740
gcc/ChangeLog
gcc/gimple-fold.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/builtin-memchr-4.c [new file with mode: 0644]