This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: GCC 4.0 Status Report (2005-03-24)
- From: Jason Merrill <jason at redhat dot com>
- To: mark at codesourcery dot com
- Cc: gcc at gcc dot gnu dot org, roger at eyesopen dot com, rth at redhat dot com, dberlin at dberlin dot org
- Date: Mon, 28 Mar 2005 23:34:02 -0500
- Subject: Re: GCC 4.0 Status Report (2005-03-24)
- References: <200503241929.j2OJT9dp018810@sirius.codesourcery.com>
On Thu, 24 Mar 2005 11:29:09 -0800, Mark Mitchell <mark@codesourcery.com> wrote:
> 19317 C++ problems with temporary return values
>
> This patch breaks Qt builds. One of my patches is implicated, but I
> believe that the consensus is that this is an NRV bug. Jason made
> several attempts at fixing this. Does anyone know what the current
> status is?
Basically, the problem is that the return slot optimization in expand_call
is incompatible with the NRVO; if the callee shares the return slot with a
variable, the caller can't share it with an object which escapes.
expand_call has no way of checking whether "target" escapes, so I think we
probably just need to disable the optimization there.
I was trying to implement the optimization at the tree level by making the
return slot argument explicit in the GIMPLE form, with
CALL_EXPR_HAS_RETURN_SLOT. This caused problems with some code that didn't
know to check that flag...which led me to think that if it requires a lot
of special handling, perhaps the flag is the wrong way to make the return
slot explicit. But I don't have a better idea atm.
Jason