public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jason Merrill <jason@redhat.com>
To: gcc@gcc.gnu.org
Subject: [tree-ssa] Simplifying TARGET_EXPR
Date: Tue, 16 Jul 2002 09:52:00 -0000	[thread overview]
Message-ID: <wvlptxoousm.fsf@prospero.cambridge.redhat.com> (raw)

Thinking about simplifying TARGET_EXPR, I see two issues to be dealt with:

1) expand_expr's treatment of TARGET_EXPR depends on whether or not it is
   being expanded with a target: if so, it initializes the target object;
   if not, it initializes a new object.  There's no way to model that
   behavior with the current simplification code, as there's no concept
   of 'target'.

   However, I think that the copy-elision should only occur under an
   INIT_EXPR, so we can check for TARGET_EXPR in simplify_modify_expr.
   This should work fine.

2) Passing a TARGET_EXPR to a call means initializing the temporary on the
   stack and passing its address to the call.  There's no way to express
   this in a simplified form; if we replace the TARGET_EXPR with the
   variable it initializes, expand_call will make a bitwise copy, which is
   wrong.  I can think of two solutions to this:

   a) Change expand_call to not copy variables with DECL_ARTIFICIAL set.
   b) Pass an ADDR_EXPR of the variable instead, and change expand_call
      to handle that case.

   My preference is for (b), as (a) might have unintended consequences.

Thoughts?

Jason

             reply	other threads:[~2002-07-16 10:22 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-16  9:52 Jason Merrill [this message]
2002-07-20 18:54 Jason Merrill
2002-07-21  0:41 ` Richard Henderson
2002-07-21 17:32 ` Mark Mitchell
2002-07-21 18:04   ` Gabriel Dos Reis
2002-07-21 18:14     ` Mark Mitchell
2002-07-21 20:39       ` Gabriel Dos Reis
2002-07-22  8:32         ` Michael Matz
2002-07-22 12:02           ` Gabriel Dos Reis
2002-07-24  3:22           ` Mark Mitchell
2002-07-22 12:33       ` Nathan Sidwell
2002-07-22 12:53         ` Gabriel Dos Reis
2002-07-22 13:10         ` Jason Merrill
2002-07-21 22:35   ` Jason Merrill

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=wvlptxoousm.fsf@prospero.cambridge.redhat.com \
    --to=jason@redhat.com \
    --cc=gcc@gcc.gnu.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).