PR tree-optimization/80934 - bzero should be assumed not to escape pointer argument
authorMartin Sebor <msebor@redhat.com>
Fri, 16 Jun 2017 20:52:03 +0000 (20:52 +0000)
committerMartin Sebor <msebor@gcc.gnu.org>
Fri, 16 Jun 2017 20:52:03 +0000 (14:52 -0600)
commitb3d8d88efa4d8467d3b0657cc8a4a3e1913d939c
tree47083e874bec3afb22da189b754fb2bf2cfc4b5b
parentaa11163b181893ed79dc1c75547b0109b342372e
PR tree-optimization/80934 - bzero should be assumed not to escape pointer argument

PR tree-optimization/80934 - bzero should be assumed not to escape pointer argument
PR tree-optimization/80933 - redundant bzero/bcopy calls not eliminated

gcc/ChangeLog:

PR tree-optimization/80933
PR tree-optimization/80934
* builtins.c (fold_builtin_3): Do not handle bcmp here.
* gimple-fold.c (gimple_fold_builtin_bcmp): New function.
(gimple_fold_builtin_bcopy, gimple_fold_builtin_bzero): Likewise.
(gimple_fold_builtin): Call them.

gcc/testsuite/ChangeLog:

PR tree-optimization/80933
PR tree-optimization/80934
* gcc.dg/fold-bcopy.c: New test.
* gcc.dg/tree-ssa/ssa-dse-30.c: Likewise..
* gcc.dg/tree-ssa/alias-36.c: Likewise.
* gcc/testsuite/gcc.dg/pr79214.c: Adjust.
* gcc.dg/tree-prof/val-prof-7.c: Likewise.
* gcc.dg/Wsizeof-pointer-memaccess1.c: Likewise.
* gcc.dg/builtins-nonnull.c: Likewise.

From-SVN: r249278
gcc/ChangeLog
gcc/builtins.c
gcc/gimple-fold.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/Wsizeof-pointer-memaccess1.c
gcc/testsuite/gcc.dg/builtins-nonnull.c
gcc/testsuite/gcc.dg/fold-bcopy.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/pr79214.c
gcc/testsuite/gcc.dg/tree-prof/val-prof-7.c
gcc/testsuite/gcc.dg/tree-ssa/alias-36.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-30.c [new file with mode: 0644]