This is the mail archive of the
mailing list for the GCC project.
Re: [C++ PATCH] Fix make_temporary_var_for_ref_to_temp (PR c++/86669)
- From: Jason Merrill <jason at redhat dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 7 Dec 2018 10:09:19 -0500
- Subject: Re: [C++ PATCH] Fix make_temporary_var_for_ref_to_temp (PR c++/86669)
- References: <20181128084247.GX12380@tucnak> <firstname.lastname@example.org> <20181205205056.GK12380@tucnak> <20181206232653.GZ12380@tucnak>
On 12/6/18 6:26 PM, Jakub Jelinek wrote:
On Wed, Dec 05, 2018 at 09:50:56PM +0100, Jakub Jelinek wrote:
On Wed, Dec 05, 2018 at 03:49:26PM -0500, Jason Merrill wrote:
On 11/28/18 3:42 AM, Jakub Jelinek wrote:
Whenever we need to clone a cdtor (either because the target doesn't support
aliases the way we need, e.g. initlist105.C testcase on darwin, where it has
been originally reported, or when it has virtual bases, like the made up
initlist106.C on x86_64-linux), we rely on DECL_INITIAL of the local
variables being unshared, because the tree unsharing gimplify.c performs
doesn't unshare DECL_INITIAL. clone_body has some code to recurse on the
DECL_INITIAL, but it handles just decls FOR_EACH_LOCAL_DECL walks. I
believe it is generally ok that not all temporaries are covered in local
decls, the gimplifier should take care of those fine if we don't need
debug info for them.
I think any temporaries that have DECL_INITIAL should be pushed so that they
end up in local_decls. set_up_extended_ref_temp already adds a DECL_EXPR
for it, I guess we need a pushdecl as well. Though the comment for
get_temp_regvar suggests that this is problematic somehow.
Ok, will play with it tomorrow.
The following fixes the testcase too and passed bootstrap/regtest on
x86_64-linux and i686-linux, ok for trunk?
2018-12-07 Jakub Jelinek <email@example.com>
* call.c (make_temporary_var_for_ref_to_temp): Call pushdecl even for