This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Still missing some addr_expr invariant recomputations


On Monday 13 September 2004 19:59, Daniel Berlin wrote:
> On Mon, 13 Sep 2004, Richard Henderson wrote:
> > On Mon, Sep 13, 2004 at 11:44:27AM -0400, Daniel Berlin wrote:
> >> If you don't feel like tracking this down, let me know, and i'll just
> >> file a bug.
> >
> > Definitely file a bug.  Too many things on the queue to keep up
> > otherwise.
>
> Okeydokey.

Try this fix please.

Index: tree-ssa-dom.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-dom.c,v
retrieving revision 2.37
diff -c -3 -p -r2.37 tree-ssa-dom.c
*** tree-ssa-dom.c	9 Sep 2004 07:54:12 -0000	2.37
--- tree-ssa-dom.c	13 Sep 2004 19:05:33 -0000
*************** Boston, MA 02111-1307, USA.  */
*** 40,45 ****
--- 40,46 ----
  #include "domwalk.h"
  #include "real.h"
  #include "tree-pass.h"
+ #include "tree-ssa-propagate.h"
  #include "langhooks.h"
  
  /* This file implements optimizations on the dominator tree.  */
*************** eliminate_redundant_computations (struct
*** 2451,2456 ****
--- 2452,2461 ----
  	retval = true;
  
        propagate_tree_value (expr_p, cached_lhs);
+ 
+       if (TREE_CODE (cached_lhs) == ADDR_EXPR)
+ 	recompute_tree_invarant_for_addr_expr (*expr_p);
+ 
        modify_stmt (stmt);
      }
    return retval;
*************** cprop_operand (tree stmt, use_operand_p 
*** 2674,2679 ****
--- 2679,2687 ----
  
        propagate_value (op_p, val);
  
+       if (TREE_CODE (val) == ADDR_EXPR)
+ 	recompute_tree_invarant_for_addr_expr (val);
+ 
        /* And note that we modified this statement.  This is now
  	 safe, even if we changed virtual operands since we will
  	 rescan the statement and rewrite its operands again.  */
*************** cprop_into_stmt (tree stmt, varray_type 
*** 2694,2707 ****
--- 2702,2721 ----
    bool may_have_exposed_new_symbols = false;
    use_operand_p op_p;
    ssa_op_iter iter;
+   tree rhs;
  
    FOR_EACH_SSA_USE_OPERAND (op_p, stmt, iter, SSA_OP_ALL_USES)
      {
+ 
        if (TREE_CODE (USE_FROM_PTR (op_p)) == SSA_NAME)
  	may_have_exposed_new_symbols
  	  |= cprop_operand (stmt, op_p, const_and_copies);
      }
  
+   rhs = get_rhs (stmt);
+   if (rhs && TREE_CODE (rhs) == ADDR_EXPR)
+     recompute_tree_invarant_for_addr_expr (rhs);
+ 
    return may_have_exposed_new_symbols;
  }
  


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]