public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "dnovillo at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/30562] [4.3 Regression] remove unused variable is removing a referenced variable (in STORED_SYMS or LOADED_SYMS)
Date: Wed, 07 Feb 2007 23:33:00 -0000	[thread overview]
Message-ID: <20070207233320.936.qmail@sourceware.org> (raw)
In-Reply-To: <bug-30562-9596@http.gcc.gnu.org/bugzilla/>



------- Comment #5 from dnovillo at gcc dot gnu dot org  2007-02-07 23:33 -------

I cannot reproduce this bug with mainline as of 2007-02-06.  The bug is still
latent though, so I will commit a variant of this patch to fix it. 
Essentially, we should leave every TREE_ADDRESSABLE variable alone so that it
can be removed by a subsequent may_alias pass:

Index: tree-ssa-live.c
===================================================================
--- tree-ssa-live.c     (revision 121699)
+++ tree-ssa-live.c     (working copy)
@@ -502,18 +502,20 @@
       cell = &TREE_CHAIN (*cell);
     }

-  /* Remove unused variables from REFERENCED_VARs.  As an special exception
-     keep the variables that are believed to be aliased.  Those can't be
-     easily removed from the alias sets and and operand caches.
-     They will be removed shortly after next may_alias pass is performed.  */
+  /* Remove unused variables from REFERENCED_VARs.  As a special
+     exception keep the variables that are believed to be aliased.
+     Those can't be easily removed from the alias sets and operand
+     caches.  They will be removed shortly after the next may_alias
+     pass is performed.  */
   FOR_EACH_REFERENCED_VAR (t, rvi)
     if (!is_global_var (t)
        && !MTAG_P (t)
        && TREE_CODE (t) != PARM_DECL
        && TREE_CODE (t) != RESULT_DECL
        && !(ann = var_ann (t))->used
-       && !ann->is_aliased && !is_call_clobbered (t) && !ann->symbol_mem_tag)
-        remove_referenced_var (t);
+       && !ann->symbol_mem_tag
+       && !TREE_ADDRESSABLE (t))
+      remove_referenced_var (t);
 }


-- 

dnovillo at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |WORKSFORME


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


  parent reply	other threads:[~2007-02-07 23:33 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-23 20:54 [Bug c++/30562] New: ice for legal code with -O2 dcb314 at hotmail dot com
2007-01-23 20:55 ` [Bug c++/30562] " dcb314 at hotmail dot com
2007-01-25 17:23 ` [Bug c++/30562] [4.3 Regression] " pinskia at gcc dot gnu dot org
2007-01-27  3:41 ` pinskia at gcc dot gnu dot org
2007-02-05 19:49 ` [Bug tree-optimization/30562] [4.3 Regression] remove unused variable is removing a referenced variable (in STORED_SYMS or LOADED_SYMS) dnovillo at gcc dot gnu dot org
2007-02-07 23:33 ` dnovillo at gcc dot gnu dot org [this message]
2007-02-08 16:56 ` dnovillo at gcc dot gnu dot org
2007-02-08 17:10 ` dnovillo at gcc dot gnu dot org
2007-02-08 17:30 ` aldot at gcc dot gnu dot org
2007-03-20 15:31 ` pthaugen at us dot ibm dot com
2007-03-20 15:37 ` pinskia at gcc dot gnu dot org
2007-03-20 15:54 ` pthaugen at us dot ibm dot com

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=20070207233320.936.qmail@sourceware.org \
    --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).