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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|tree-optimization           |middle-end

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
Agreed that having an attribute to annotate free-like functions similar to how
we have one for malloc-like funtions would be nice.

How are semantics in the case such a function throws?  Or shall 'free' imply
nothrow and that it doesn't return abnormally (it doesn't call longjmp),
'leaf' would be a bit too strong but possibly easiest to require?

We could also simply say that the pointed to object is released (it's contents
become undefined) upon exiting the function by any means (normal return, EH
or abnormal).

Reply via email to