From: Alexandre Oliva <aoliva@redhat.com>
To: Jason Merrill <jason@redhat.com>
Cc: gcc-patches List <gcc-patches@gcc.gnu.org>
Subject: Re: [PR c++/84593] ice on braced init with uninit ref field
Date: Tue, 06 Mar 2018 05:43:00 -0000 [thread overview]
Message-ID: <or6069u5df.fsf@lxoliva.fsfla.org> (raw)
In-Reply-To: <CADzB+2mKBW0ZCS2NKoQE+8exW+EKYWM5GesZrajaJnNRJe_+uA@mail.gmail.com> (Jason Merrill's message of "Fri, 2 Mar 2018 14:01:53 -0500")
On Mar 2, 2018, Jason Merrill <jason@redhat.com> wrote:
> On Fri, Mar 2, 2018 at 2:57 AM, Alexandre Oliva <aoliva@redhat.com> wrote:
>> + gcc_assert (TREE_CODE (type) == REFERENCE_TYPE);
>> + init = fold (convert (type, integer_zero_node));
> Maybe build_zero_cst?
Sure.
I wonder, is there any reason to not change any of these to use
build_zero_cst, too?
else if (TYPE_PTR_OR_PTRMEM_P (type))
init = fold (convert (type, nullptr_node));
else if (SCALAR_TYPE_P (type))
init = fold (convert (type, integer_zero_node));
I suppose pointers to members might need an explicit conversion, which
build_zero_cst might fallback to if it doesn't consider them aggregate
types. As for scalar types, are there any C++-specific scalar types
that build_zero_cst wouldn't know how to deal with? Anyway, it's
probably not the time to change these, if it doesn't fix a regression.
Just curious.
--
Alexandre Oliva, freedom fighter http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/ FSF Latin America board member
Free Software Evangelist|Red Hat Brasil GNU Toolchain Engineer
next prev parent reply other threads:[~2018-03-06 5:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-28 12:08 Alexandre Oliva
2018-02-28 18:57 ` Jason Merrill
2018-03-02 7:57 ` Alexandre Oliva
2018-03-02 19:02 ` Jason Merrill
2018-03-06 5:43 ` Alexandre Oliva [this message]
2018-03-06 15:28 ` Jason Merrill
2018-03-06 6:14 ` Alexandre Oliva
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=or6069u5df.fsf@lxoliva.fsfla.org \
--to=aoliva@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jason@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).