This is the mail archive of the
mailing list for the GCC project.
Re: Looking for some help with GCC 6 and bad code generation
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: Zan Lynx <zlynx at acm dot org>
- Cc: gcc <gcc at gcc dot gnu dot org>
- Date: Thu, 21 Apr 2016 10:43:47 +0100
- Subject: Re: Looking for some help with GCC 6 and bad code generation
- Authentication-results: sourceware.org; auth=none
- References: <571828AB dot 6060108 at acm dot org>
This is the wrong mailing list for such questions, the gcc-help list
would be appropriate.
On 21 April 2016 at 02:11, Zan Lynx wrote:
> I would like someone to look at this and tell me this is an already
> fixed bug. Or that recent GCC patches may have fixed it. :-)
> Or it would also be great to get some advice on building a reproducer
> without needing to include many megabytes of proprietary code plus Boost.
> I've been using Fedora 24 Alpha and of course I've somehow managed to
> write some C++ code even more confusing for GCC than Firefox. Heh.
> The problem is a crash when std::string tries to free memory from a
> temporary std::string that was bound to a const reference.
This usually means you have a reference to a local or a reference to a
temporary that has gone out of scope. With the COW std::string you
could usually get away with that, because the actual string
representation wasn't always destroyed when objects went out of scope.
With the new std::string you have to be more careful, invalid uses of
destroyed objects result in accesses to deleted or clobbered memory.