Can realloc be marked as a mallloc-like function?

Richard Henderson
Wed Jul 18 16:10:00 GMT 2007

On Tue, Jul 17, 2007 at 09:53:30AM -0000, Wolfram Gloger wrote:
> Surely you agree that in my second example, "*p = 0" _cannot_ be moved
> after the call to destroy_something_and_allocate_anotherthing(p)?

It can't be moved after, but it could be removed entirely as dead code.

I don't think we have a pass that will do that presently, but I see no
reason why it couldn't happen some day, more or less automatically, with
a pass that analyzes lifetimes of dynamic allocations.


More information about the Gcc mailing list