public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jan Hubicka <jh@suse.cz>
To: Diego Novillo <dnovillo@redhat.com>
Cc: Jan Hubicka <jh@suse.cz>, "gcc@gcc.gnu.org" <gcc@gcc.gnu.org>,
	gcc-patches@gcc.gnu.org
Subject: Re: aliasing question
Date: Wed, 08 Sep 2004 20:05:00 -0000	[thread overview]
Message-ID: <20040908200553.GR22818@kam.mff.cuni.cz> (raw)
In-Reply-To: <1094566924.21733.36.camel@localhost.localdomain>

> On Tue, 2004-09-07 at 06:51, Jan Hubicka wrote:
> 
> >   #   V_MUST_DEF <value_49>;
> >   value = T.4862_48;
> > 
> > and alias1 dump:
> > 
> >   #   value_229 = V_MAY_DEF <value_19>;
> >   value = T.4862_48;
> > 
> > Why the MUST_DEF is getting converted to MAY_DEF in such a obvious case
> > for MUST_DEF?
> > 
> Before aliasing, 'value' did not belong to any alias set, but after
> aliasing it is.  If we didn't do that, suppose that:
> 
> *p, alias tag TMT.1, alias set of TMT.1 = { value }
> 
>      1. p = (cond) ? &value : foo ();
>      2. *p = 3;
>      3. value = T.4862;
>      4. return *p;
> 
> If you put a V_MUST_DEF in statement #3, you will consider '*p = 3'
> dead.  Perhaps, we could put a V_MUST_DEF if there were more than one
> element in TMT.1's alias set.  Not sure how much would that buy, but it
> may be an interesting experiment.

Hi,
as discussed on the IRC, this check looks unnecesary after all (ie at
least my understanding is that optimizer should not conclude the *p dead
just from the fact that all object in the alias set has been mustdeffed
because the pointer still can point elsewhere).  I've
bootstrapped&regtested the attached patch and commited it after Diego's
approval.

Honza

2004-09-08  Jan Hubicka  <jh@suse.cz>
	* tree-ssa-operands.c (add_stmt_operand): Use V_MUST_DEF even for
	variables being alias set.
Index: tree-ssa-operands.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-operands.c,v
retrieving revision 2.36
diff -c -3 -p -r2.36 tree-ssa-operands.c
*** tree-ssa-operands.c	5 Sep 2004 15:24:15 -0000	2.36
--- tree-ssa-operands.c	7 Sep 2004 15:05:47 -0000
*************** add_stmt_operand (tree *var_p, tree stmt
*** 1487,1502 ****
  	  /* The variable is not aliased or it is an alias tag.  */
  	  if (flags & opf_is_def)
  	    {
! 	      if (v_ann->is_alias_tag)
! 	        {
! 		  /* Alias tagged vars get V_MAY_DEF to avoid breaking
! 		     def-def chains with the other variables in their
! 		     alias sets.  */
! 		  if (s_ann)
! 		    s_ann->makes_aliased_stores = 1;
! 		  append_v_may_def (var);
! 		}
! 	      else if (flags & opf_kill_def)
  		{
  #if defined ENABLE_CHECKING
  		  /* Only regular variables may get a V_MUST_DEF
--- 1487,1493 ----
  	  /* The variable is not aliased or it is an alias tag.  */
  	  if (flags & opf_is_def)
  	    {
! 	      if (flags & opf_kill_def)
  		{
  #if defined ENABLE_CHECKING
  		  /* Only regular variables may get a V_MUST_DEF

      reply	other threads:[~2004-09-08 20:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-07 10:51 Jan Hubicka
2004-09-07 14:22 ` Diego Novillo
2004-09-08 20:05   ` Jan Hubicka [this message]

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=20040908200553.GR22818@kam.mff.cuni.cz \
    --to=jh@suse.cz \
    --cc=dnovillo@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --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).