https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93644
--- Comment #2 from Marc Glisse <glisse at gcc dot gnu.org> --- # buffer_2 = PHI <&stack_bufD.1939(3), buffer_7(D)(9)> buffer_18 = ASSERT_EXPR <buffer_2, buffer_2 != &stack_bufD.1939>; Can't we deduce from this buffer_18 = buffer_7(D) ? Of course that's not a general solution, but it looks like a sensible optimization, and in the reduced testcase it should remove &stack_buf from the possible return values.