https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78886

--- Comment #8 from Marc Glisse <glisse at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #5)
> I'd say tree-ssa-strlen.c is not the pass that should remove the malloc.

We probably want another PR about this, because a malloc whose return value is
ignored should not have survived all the way to the strlen pass.
gimple_fold_builtin looks like a place where we could handle this. I don't know
if there is some attribute that could be put on malloc so that DCE would handle
it automatically...

Reply via email to