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

--- Comment #5 from Marc Glisse <glisse at gcc dot gnu.org> ---
(In reply to Manuel López-Ibáñez from comment #4)
> At some moment (in dcce1), gcc decides that x = 4 is not needed. For the
> same reason, it could realize that MEM[(struct foo *)&D.2281] = &x must
> produce a dangling reference, no?

A clobber implies that the content is lost, so it is useless to store something
there right before the clobber (I assume that's why the store is removed, I
didn't check), but I don't believe it implies that the memory location is
reclaimed (does it?), so it would be fine to store a pointer in some struct,
kill what that pointer points to, re-create something there, use that, etc.
Without the return statement, it is normal to remove x=4 (because of the
clobber), but I don't see anything to warn about, while we could warn with a
return statement and no clobber, so the 2 things seem quite different.

Of course I may be looking at this the wrong way.

Reply via email to