This is the mail archive of the
mailing list for the GCC project.
Re: [C++ patch] Set attributes for C++ runtime library calls
- From: Jason Merrill <jason at redhat dot com>
- To: Gabriel Dos Reis <gdr at integrable-solutions dot net>, Jan Hubicka <hubicka at ucw dot cz>
- Cc: Alexander Monakov <amonakov at ispras dot ru>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 26 Aug 2013 10:07:18 -0400
- Subject: Re: [C++ patch] Set attributes for C++ runtime library calls
- Authentication-results: sourceware.org; auth=none
- 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> <20130822152111 dot GB19256 at kam dot mff dot cuni dot cz> <CAAiZkiA5wyTn0A_eMZ8d-crnq0KY0ut6R1ffh+2xsTp51dkWEg at mail dot gmail dot com> <20130822153958 dot GE19256 at kam dot mff dot cuni dot cz> <CAAiZkiCWf43bVyuVJC+D1=ghSLGTXsi5FbWVdUwX1kq4cNvavg at mail dot gmail dot com> <20130822161644 dot GC24022 at kam dot mff dot cuni dot cz> <CAAiZkiC7tztfKcwET95cacX52=xdRf+QuuUEUfOXTF+9QD69DA at mail dot gmail dot com>
On 08/22/2013 12:45 PM, Gabriel Dos Reis wrote:
If the user-supplied operator new returns &a, then it must
also ensure that 'a' is not used anywhere else -- e.g. I you can't
do lvalue-to-value conversion on 'a' to see what is written there.
Because its storage has been reused. That is, aliasing is framed
in terms of object lifetime and uniqueness of ownership.
Do you have a reference for this? The wording in 3.8 seems to only
restrict how a pointer is used when there is no object in the storage,
it doesn't say anything about using a pointer to access a different
object at the same location.
This issue seems to be core 1338:
which has priority 2, so it's not likely to get resolved any time soon.
I'll ask to reconsider the priority at the next meeting.
We probably can go with -fno-user-overwritten-new or something similar?
I'd name it something like -fno-aliased-global-new, which would add the
malloc attribute to the built-in declarations.