public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/35290] Missing dead store elimination
Date: Wed, 10 Nov 2010 12:32:00 -0000	[thread overview]
Message-ID: <bug-35290-4-8zghPKunyf@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-35290-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35290

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|unassigned at gcc dot       |rguenth at gcc dot gnu.org
                   |gnu.org                     |

--- Comment #4 from Richard Guenther <rguenth at gcc dot gnu.org> 2010-11-10 12:32:16 UTC ---
Well, it's not working on the tree level to make it cheaper:

  /* We deliberately stop on clobbering statements and not only on
     killing ones to make walking cheaper.  Otherwise we can just
     continue walking until both stores have equal reference trees.  */
  while (!stmt_may_clobber_ref_p (temp, gimple_assign_lhs (stmt)));

changing that to

  while (!stmt_kills_ref_p (temp, gimple_assign_lhs (stmt)));

will make it work (and slower).

Also needs (possibly unsafe in general if used cross loop iteration)

Index: gcc/tree-ssa-alias.c
===================================================================
--- gcc/tree-ssa-alias.c        (revision 166526)
+++ gcc/tree-ssa-alias.c        (working copy)
@@ -1577,7 +1577,12 @@ stmt_kills_ref_p_1 (gimple stmt, ao_ref
       base = get_ref_base_and_extent (lhs, &offset, &size, &max_size);
       /* We can get MEM[symbol: sZ, index: D.8862_1] here,
         so base == ref->base does not always hold.  */
-      if (base == ref->base)
+      if (base == ref->base
+         || (TREE_CODE (base) == MEM_REF
+             && TREE_CODE (ref->base) == MEM_REF
+             && TREE_OPERAND (base, 0) == TREE_OPERAND (ref->base, 0)
+             && tree_int_cst_equal (TREE_OPERAND (base, 1),
+                                    TREE_OPERAND (ref->base, 1))))
        {
          /* For a must-alias check we need to be able to constrain
             the accesses properly.  */


  parent reply	other threads:[~2010-11-10 12:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-35290-4@http.gcc.gnu.org/bugzilla/>
2010-11-09 23:11 ` [Bug middle-end/35290] " xinliangli at gmail dot com
2010-11-09 23:22 ` [Bug tree-optimization/35290] " pinskia at gcc dot gnu.org
2010-11-10 12:32 ` rguenth at gcc dot gnu.org [this message]
2014-09-05 10:58 ` glisse at gcc dot gnu.org

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=bug-35290-4-8zghPKunyf@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).