public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andrew MacLeod <amacleod@redhat.com>
To: Andrew MacLeod <amacleod@redhat.com>
Cc: gcc mailing list <gcc@gcc.gnu.org>
Subject: Re: [tree-ssa] Out of SSA status and issues
Date: Mon, 12 May 2003 18:57:00 -0000	[thread overview]
Message-ID: <1052765152.3372.28.camel@p4> (raw)
In-Reply-To: <1052750563.2730.317.camel@p4>

On Mon, 2003-05-12 at 10:42, Andrew MacLeod wrote:

> 
> The second case occurs when a derefernce is copy propagated into a PHI
> node:
>  
>    if (T.1_5 != 0B)
>     {
> 
>       #   VUSE <(*map)_3>;
>       #   VUSE <map_4>;
>       T.2_8 = map->compact_to_partition;
>       i.3_9 = (unsigned int)i_6;
>       T.4_10 = i.3_9 * 4;
>       T.5_11 = (int *)T.4_10;
> 
>       #   (*T.6)_13 = VDEF <(*T.6)_7>;
>       T.6_12 = T.2_8 + T.5_11;
> 
>       #   VUSE <T.6_12>;
>       i_14 = (*T.6)_13
>     };
>   #   i_1 = PHI <i_6(0), (*T.6)_13(1)>;
>   #   (*T.6)_2 = PHI <(*T.6)_7(0), (*T.6)_13(1)>;
> 
>   #   (*T.7)_17 = VDEF <(*T.7)_16>;
>   #   VUSE <(*map)_3>;
>   #   VUSE <map_4>;
>      
> The value of i_14 has been propagated into the PHI node. DCE the deletes
> the stmt 
>    i_14 = (*T.6)_13
> 
> When we go to rewrite this, all we know is that its a derefernce of T.6.
> There is no VUSE now to look at to figure out what the correct pointer
> it.  The original def has it as T.6_12. The information could be found
> by looking for the def of (*T.6)_13 (which is virtual), and looking at
> the real def, which is T.6_12. I am about to try that in my hack and see
> if it works.
>

Actually, is propagating this copy a safe thing to do? 

Copy propagation simply looks at the def, and if the stmt is a copy,
copies it... So if there was a store after the definition of i_14 which
killed the memory location that T.6_12 points to, then the PHI is going
to get the wrong result...  isn't it?

ie it would look something like this hacked up example:
 
      #   (*T.6)_13 = VDEF <(*T.6)_7>;
      T.6_12 = T.2_8 + T.5_11;

      #   VUSE <T.6_12>;
      i_14 = (*T.6)_13

      #   (*T.6)_22 = VDEF <(*T.6)_13>      
      #   VUSE <T.6_12>
      *T.6 = 30;
    };
  #   i_1 = PHI <i_6(0), (*T.6)_13(1)>;

Or is there a reason that copyprop would never happen?
Should we never copyprop an indirect reference?

Andrew

  parent reply	other threads:[~2003-05-12 18:57 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-12 14:42 Andrew MacLeod
2003-05-12 15:38 ` Diego Novillo
2003-05-12 15:57   ` Andrew MacLeod
2003-05-12 16:05     ` Michael Matz
2003-05-12 16:10       ` Andrew MacLeod
2003-05-12 16:16       ` law
2003-05-12 17:08     ` law
2003-05-12 17:12       ` Andrew MacLeod
2003-05-12 17:26         ` law
2003-05-12 18:57 ` Andrew MacLeod [this message]
2003-05-13  9:07   ` Michael Matz
2003-05-13 12:42     ` Diego Novillo
2003-05-13 12:50       ` Andrew MacLeod
2003-05-13 13:05         ` Diego Novillo
2003-05-13 13:29           ` Andrew MacLeod
2003-05-13 13:57             ` Diego Novillo
2003-05-13 12:57       ` Michael Matz
2003-05-13 13:11         ` Diego Novillo
2003-05-13 13:18           ` Andrew MacLeod
2003-05-14 17:19             ` Jan Vroonhof
2003-05-14 18:05               ` Andrew MacLeod
2003-05-14 18:33               ` Diego Novillo
2003-05-14 19:11                 ` Daniel Berlin
2003-05-13 15:01         ` Daniel Berlin
2003-05-13 12:33   ` Diego Novillo
2003-05-13 12:49     ` Andrew MacLeod
2003-05-13 12:58       ` Diego Novillo
2003-05-13 13:17 Richard Kenner
2003-05-13 13:27 ` Diego Novillo
2003-05-13 13:40 ` Michael Matz
2003-05-13 15:08 ` Michael S. Zick
2003-05-13 13:42 Richard Kenner
2003-05-13 15:23 Richard Kenner
2003-05-13 18:50 ` Geoff Keating
2003-05-13 23:28   ` Michael S. Zick
2003-05-17 17:19 ` Michael S. Zick

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=1052765152.3372.28.camel@p4 \
    --to=amacleod@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).