https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80613
--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> --- Hmm, cddce leaves us with free (_11) and the def of _11 removed. _11 was Deleting LHS of call: _11 = strdup (&d); so caused by 2017-04-29 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. (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. which failed to update BUILT_IN_FREE handling properly.