On 02/25/2017 01:40 AM, Prathamesh Kulkarni wrote:
Hi,
The attached patch deletes calls to strdup, strndup if it's
return-value is unused,
and same for realloc if the first arg is NULL.
Bootstrap+tested on x86_64-unknown-linux-gnu.
OK for GCC 8 ?

Thanks,
Prathamesh


pr79697-1.txt


2017-02-25  Prathamesh Kulkarni<prathamesh.kulka...@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.

testsuite/
        * gcc.dg/tree-ssa/pr79697.c: New test.
OK for the trunk.

jeff

Reply via email to