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