PR tree-optimization/92501 - strncmp with constant unterminated arrays not folded
authorMartin Sebor <msebor@redhat.com>
Fri, 22 Nov 2019 16:39:37 +0000 (16:39 +0000)
committerMartin Sebor <msebor@gcc.gnu.org>
Fri, 22 Nov 2019 16:39:37 +0000 (09:39 -0700)
commitd2f8402a0886db2b2d33ed09e51cf27cc85db5e4
treee3ef393eca7df548503d7fd5232b88831573fd91
parentaa84ec8415bd413b693e5ea0610e98f3b6216ad5
PR tree-optimization/92501 - strncmp with constant unterminated arrays not folded

gcc/testsuite/ChangeLog:

PR tree-optimization/92501
* gcc.dg/strcmpopt_7.c: New test.

gcc/ChangeLog:

PR tree-optimization/92501
* gimple-fold.c ((gimple_fold_builtin_string_compare): Let strncmp
handle unterminated arrays.  Rename local variables for clarity.

From-SVN: r278621
gcc/ChangeLog
gcc/gimple-fold.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/strcmpopt_7.c [new file with mode: 0644]