2017-04-29 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
commit2c98f97230beff3b37c26aabde0ada6096a9413c
authorprathamesh3492 <prathamesh3492@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 29 Apr 2017 10:05:13 +0000 (29 10:05 +0000)
committerprathamesh3492 <prathamesh3492@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 29 Apr 2017 10:05:13 +0000 (29 10:05 +0000)
tree9e0c2d1d28b1e5baecc44a4c7b78ad81f0e1bef3
parent8552a1d6dc83f1c6913ccacc0a31899102c193a8
2017-04-29  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>

PR tree-optimization/79697
* tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Check if callee
is BUILT_IN_STRDUP, BUILT_IN_STRNDUP, BUILT_IN_REALLOC.
(propagate_necessity): Check if def_callee is BUILT_IN_STRDUP or
BUILT_IN_STRNDUP.
* gimple-fold.c (gimple_fold_builtin_realloc): New function.
(gimple_fold_builtin): Call gimple_fold_builtin_realloc.

testsuite/
* gcc.dg/tree-ssa/pr79697.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@247407 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/gimple-fold.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/pr79697.c [new file with mode: 0644]
gcc/tree-ssa-dce.c