More function decorations II (pool_allocator, mt_allocator, debug, stl_list)

Gabriel Dos Reis dosreis@gmail.com
Mon Apr 20 18:49:00 GMT 2009


On Mon, Apr 20, 2009 at 3:31 AM, Richard Guenther <rguenther@suse.de> wrote:
> On Fri, 17 Apr 2009, Paolo Carlini wrote:
>
>> Hi,
>> > Hi,
>> > this patch adds decorations to couple more files.  I guess nothing
>> > earthshaking here.
>> >
>> I see, patch is ok, thanks.
>> > I wonder, should not be the allocators somehow marked via malloc
>> > attribute?  That one provide very important hint for alias analysis and
>> > also Martin's IPA stuff.
>> >
>> I'd like to ear Richard first about this issue, because some problems we
>> had in the past with dynamic memory allocation vs alias analysis were
>> *really* nasty...
>
> In my opinion adding attribute malloc to C++ new (_not_ the placement
> new variants!) does not add any potential sources for miscompiles.

Even when the operator new implementation just returns a pointer
into a storage buffer statically allocated (therefore another object)
in the problem?  Is this something documented for the attribute?

> Miscompiles would (and still do!) happen if we inline news, but in
> that case knowledge of attribute malloc is lost and thus the annotation
> is a no-op.
>
> Richard.
>



More information about the Libstdc++ mailing list