http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57111
--- Comment #6 from Marc Glisse <glisse at gcc dot gnu.org> 2013-04-30 22:07:02 UTC --- (In reply to comment #5) > It seems to me that the option "free-nonheap-object" does not work in gcc. You need to add -O2 (maybe -O1 is enough, sometimes you need -O3), otherwise gcc does not propagate the information of what p is all the way to free.