This is the mail archive of the
mailing list for the GCC project.
Re: [C++ patch] Set attributes for C++ runtime library calls
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Alexander Monakov <amonakov at ispras dot ru>, Jan Hubicka <hubicka at ucw dot cz>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Jason Merrill <jason at redhat dot com>
- Date: Thu, 22 Aug 2013 10:27:39 -0500
- Subject: Re: [C++ patch] Set attributes for C++ runtime library calls
- References: <20130822131927 dot GA18084 at kam dot mff dot cuni dot cz> <CAAiZkiDRZj-Fzy2+zUo9Z2B5ShvJ6K_duNyX1SKfrEZeX1NNZQ at mail dot gmail dot com> <alpine dot LNX dot 2 dot 00 dot 1308221836460 dot 30125 at monopod dot intra dot ispras dot ru> <CAAiZkiAC4mGUecOkKUNmXSfNEFMZrM5_EEUZib6HtYLT6wXfjQ at mail dot gmail dot com> <20130822145634 dot GC1814 at tucnak dot redhat dot com>
On Thu, Aug 22, 2013 at 9:56 AM, Jakub Jelinek <firstname.lastname@example.org> wrote:
> On Thu, Aug 22, 2013 at 09:53:35AM -0500, Gabriel Dos Reis wrote:
>> On Thu, Aug 22, 2013 at 9:38 AM, Alexander Monakov <email@example.com> wrote:
>> > On Thu, 22 Aug 2013, Gabriel Dos Reis wrote:
>> >> > - I would like to recall issue if we can make NEW_EXPR annotated with
>> >> > MALLOC attribute. Without it, it is basically impossible to track
>> >> > any dynamically allocated objects in the middle-end
>> >> operator new is replaceable by user program.
>> > But so is malloc?
>> no, malloc isn't replaceable.
> Is it such a good idea to replace something gcc during bootstrap can
> optimize well (malloc/xmalloc etc.) with something that it can't (operator new)?
I think we may have terminology problems here.
A placement-new, like the one I used in my recent patch, is operationally
the identity function (in addition to informing the alias analyzer about
the beginning of a new object lifetime).
'operator new' is an allocator function. I didn't use it.