This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/54954] malloc optimizations not disabled by -fno-builtin
- From: "pinskia at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 20 Nov 2013 18:06:11 +0000
- Subject: [Bug c/54954] malloc optimizations not disabled by -fno-builtin
- Auto-submitted: auto-generated
- References: <bug-54954-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54954
--- Comment #8 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to swalter from comment #7)
> (In reply to Andrew Pinski from comment #6)
> > The header file malloc.h (which is non-standard by the way) has the
> > attribute malloc on the malloc function call.
> >
> > So this is invalid.
>
> Sorry, can you spell that out for me? You're saying that the behavior I'm
> seeing is because I'm using malloc.h for the definition of malloc(), rather
> than stdlib.h? malloc.h's definition of malloc has __attribute__((malloc)),
> so that allows gcc to perform the optimization even when -fno-builtin in
> thrown?
No I am saying the definition inside both malloc.h and stdlib.h has the
attribute on it which allows gcc to perform the optimization even when
-fno-builtin is used. My comment about malloc.h being non-standard was an
aside comment and just pointing out the use of a non-standard header.