This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/38509] Bogus "attempt to free a non-heap object" warning
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 Dec 2008 22:42:00 -0000
- Subject: [Bug middle-end/38509] Bogus "attempt to free a non-heap object" warning
- References: <bug-38509-17071@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from pinskia at gcc dot gnu dot org 2008-12-12 22:42 -------
static int non_heap = 0;
<bb 2>:
if (non_heap != 0)
goto <bb 3>;
else
goto <bb 4>;
<bb 3>:
__builtin_free (&non_heap);
Hmm, since the address of non_heap is taken, we don't optimize away the
conditional.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Component|c++ |middle-end
Keywords| |diagnostic, missed-
| |optimization
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38509