public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jason Merrill <jason@redhat.com>
To: Alexandre Oliva <aoliva@redhat.com>
Cc: gcc-patches List <gcc-patches@gcc.gnu.org>,
	Nathan Sidwell <nathan@acm.org>
Subject: Re: [PATCH] [PR c++/84943] allow folding of array indexing indirect_ref
Date: Fri, 23 Mar 2018 16:45:00 -0000	[thread overview]
Message-ID: <CADzB+2nnSeH1Oe37kG9iWVMrgBGwgxNDKE0SWP9oFqJYvDXR_Q@mail.gmail.com> (raw)
In-Reply-To: <orwoy2py0o.fsf@lxoliva.fsfla.org>

On Fri, Mar 23, 2018 at 12:17 PM, Alexandre Oliva <aoliva@redhat.com> wrote:
> On Mar 23, 2018, Jason Merrill <jason@redhat.com> wrote:
>
>> On Thu, Mar 22, 2018 at 7:00 PM, Alexandre Oliva <aoliva@redhat.com> wrote:
>>> fn[0]() ICEs because we end up with addr_expr of a decl, and that
>>> should only happen for artificial or otherwise special internal
>>> functions.  For anything else, we should find the decl earlier, but we
>>> don't because we build an indirect_ref or an addr_expr and don't
>>> cancel them out.
>
>> That's deliberate; we recently changed the C++ front end to defer most
>> folding until genericization time.
>
> Ok, I can see a number of possibilities as to why this is done, which
> would lead to different choices in the implemnetation of a fix for this
> PR:
>
> a. to mirror the structure of the program as closely as possible

> b. to sort-of mirror the structure of the program for the benefit of
>   operator overloading during template expansion
>
> c. to allow such constructs as *&x to hide symbolic information about x,
>   so that stuff that isn't part of the type system proper (attributes?
>   concepts?) can be "hidden" by such artifacts

Mostly c, as the difference is significant for some language rules.
But in some cases, mainly when we're dealing with internally generated
trees, we do fold.

Seems like cp_fold should update CALL_EXPR_FN with "callee" if non-null.

Jason

  reply	other threads:[~2018-03-23 16:44 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-22 23:03 Alexandre Oliva
2018-03-23 13:12 ` Jason Merrill
2018-03-23 16:19   ` Alexandre Oliva
2018-03-23 16:45     ` Jason Merrill [this message]
2018-03-23 20:59       ` Jason Merrill
2018-03-23 22:04         ` Jason Merrill
2018-03-28  6:31           ` Alexandre Oliva
2018-03-28 19:21             ` Jason Merrill
2018-03-30  1:07               ` Alexandre Oliva
2018-03-30  2:31                 ` Alexandre Oliva
2018-03-30  7:49                   ` Alexandre Oliva
2018-03-30 14:46                     ` Jason Merrill
2018-03-31  8:23                       ` Alexandre Oliva
2018-04-03  1:17                         ` Jason Merrill
2018-04-03  7:44                           ` Alexandre Oliva
2018-04-03 15:48                             ` Jason Merrill
2018-04-03 15:48                               ` Jason Merrill
2018-04-04  2:41                                 ` Alexandre Oliva
2018-03-23 20:55   ` 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=CADzB+2nnSeH1Oe37kG9iWVMrgBGwgxNDKE0SWP9oFqJYvDXR_Q@mail.gmail.com \
    --to=jason@redhat.com \
    --cc=aoliva@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=nathan@acm.org \
    /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).