public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jason Merrill <jason@redhat.com>
To: kenner@vlsi1.ultra.nyu.edu (Richard Kenner)
Cc: pinskia@physics.uc.edu, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] fix PR middle-end/17885, gimplifing of volatile &a->b
Date: Mon, 18 Oct 2004 19:46:00 -0000	[thread overview]
Message-ID: <xyp8ya324k3.fsf@miranda.boston.redhat.com> (raw)
In-Reply-To: <10410181940.AA07336@vlsi1.ultra.nyu.edu> (Richard Kenner's message of "Mon, 18 Oct 04 15:40:57 EDT")

On Mon, 18 Oct 04 15:40:57 EDT, kenner@vlsi1.ultra.nyu.edu (Richard Kenner) wrote:

>     Because the COMPONENT_REF has its TREE_SIDE_EFFECTS set then by
>     recompute_tree_invarant_for_addr_expr so does the ADDR_EXPR, this
>     might be a bug in that function though.
>
> I think it is.  But the TREE_SIDE_EFFECTS bit in the COMPONENT_REF is
> ignored; the issue is that the operand of the COMPONENT_REF also must have
> TREE_SIDE_EFFECTS set.  But I agree that shouldn't set TREE_SIDE_EFFECTS of
> an ADDR_EXPR: only if the computation of the *address* has side-effects should
> TREE_SIDE_EFFECTS be set.
>
> Specifically, I think the line
>
>       se |= TREE_SIDE_EFFECTS (node);
>
> should be deleted.

I think that should still be the general case; if we're taking the address
of, say, a struct returned from a function, we want to propagate
TREE_SIDE_EFFECTS from the call to the ADDR_EXPR.

But we should special-case COMPONENT_REF so that TREE_SIDE_EFFECTS is
propagated from op0 to the ADDR_EXPR, not from the ref itself.  With
appropriate recursion.

Jason

  reply	other threads:[~2004-10-18 19:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-18 19:41 Richard Kenner
2004-10-18 19:46 ` Jason Merrill [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-10-18 21:00 Richard Kenner
2004-10-18 19:57 Richard Kenner
2004-10-18 20:39 ` Andrew Pinski
2004-10-18 19:50 Richard Kenner
2004-10-18 14:25 Andrew Pinski
2004-10-18 17:56 ` Richard Henderson
2004-10-18 18:41   ` Andrew Pinski
2004-10-18 21:22     ` Richard Henderson
2004-10-18 21:35     ` Richard Henderson
2004-10-18 19:49 ` Jeffrey A Law

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=xyp8ya324k3.fsf@miranda.boston.redhat.com \
    --to=jason@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=kenner@vlsi1.ultra.nyu.edu \
    --cc=pinskia@physics.uc.edu \
    /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).