From: Jason Merrill <jason@redhat.com>
To: Jakub Jelinek <jakub@redhat.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [C++ PATCH] Fix make_temporary_var_for_ref_to_temp (PR c++/86669)
Date: Fri, 07 Dec 2018 15:09:00 -0000 [thread overview]
Message-ID: <54f69ac5-9155-6a66-bc3c-a795fa883fe4@redhat.com> (raw)
In-Reply-To: <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 <jakub@redhat.com>
>
> PR c++/86669
> * call.c (make_temporary_var_for_ref_to_temp): Call pushdecl even for
> automatic vars.
OK, thanks.
Jason
prev parent reply other threads:[~2018-12-07 15:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-28 8:42 [C++ PATCH] Fix clone_body " Jakub Jelinek
2018-11-29 7:45 ` Jakub Jelinek
2018-12-05 11:04 ` Patch ping (Re: [C++ PATCH] Fix clone_body (PR c++/86669)) Jakub Jelinek
2018-12-05 20:49 ` [C++ PATCH] Fix clone_body (PR c++/86669) Jason Merrill
2018-12-05 20:51 ` Jakub Jelinek
2018-12-06 23:27 ` [C++ PATCH] Fix make_temporary_var_for_ref_to_temp " Jakub Jelinek
2018-12-07 15:09 ` Jason Merrill [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54f69ac5-9155-6a66-bc3c-a795fa883fe4@redhat.com \
--to=jason@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jakub@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).