This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/54833] Don't wrap __builtin_free(a) in if (a != NULL)
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 07 Oct 2012 15:51:51 +0000
- Subject: [Bug fortran/54833] Don't wrap __builtin_free(a) in if (a != NULL)
- Auto-submitted: auto-generated
- References: <bug-54833-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54833
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-10-07 15:51:51 UTC ---
It depends on what is the probability that the pointer is NULL. If it is
unlikely, then unconditional free is the right choice, if NULL is very likely,
then the test may be less expensive (avoids call including likely PLT slot
overhead and comparison at least).