re PR middle-end/78809 (Inline strcmp with small constant strings)
authorQing Zhao <qing.zhao@oracle.com>
Fri, 17 Nov 2017 05:32:05 +0000 (05:32 +0000)
committerJeff Law <law@gcc.gnu.org>
Fri, 17 Nov 2017 05:32:05 +0000 (22:32 -0700)
commitcaed5c92712701509413c579fb004faa965e4004
treee6a25de7a4c912e87fdd28ec9a45b3cfc6aa2388
parent5958557b750254f28954d1ed6a3ce0b9cb48c6fb
re PR middle-end/78809 (Inline strcmp with small constant strings)

2017-11-15  Qing Zhao <qing.zhao@oracle.com>

PR middle-end/78809
* gimple-fold.c (gimple_fold_builtin_string_compare): Add handling
of replacing call to strncmp with corresponding call to strcmp when
meeting conditions.

PR middle-end/78809
* gcc.dg/strcmpopt_1.c: New test.

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