tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Do not perform reassociation...
authorJeff Law <law@redhat.com>
Thu, 10 Nov 2005 18:31:07 +0000 (11:31 -0700)
committerJeff Law <law@gcc.gnu.org>
Thu, 10 Nov 2005 18:31:07 +0000 (11:31 -0700)
        * tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Do not
        perform reassociation if the parent statement will not die as
        a result of the optimization.

From-SVN: r106744

gcc/ChangeLog
gcc/tree-ssa-dom.c

index 3a0cbc6a21e7d3d03fa8726eac6cb783b1db8817..66e0e1d3f1c00e07c639339bd5473ac9014f80d3 100644 (file)
@@ -1,3 +1,10 @@
+2005-11-04  Jeff Law  <law@redhat.com>
+
+       PR middle-end/23181
+       * tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Do not
+       perform reassociation if the parent statement will not die as
+       a result of the optimization.
+
 2005-11-10  Daniel Berlin  <dberlin@dberlin.org>
 
        * tree-ssa-alias.c (compute_may_aliases): Remove call to 
index cb5eeb03a2f28cf6b8a80730a1a55bf7c6c41eec..1e0ebbce9a5eb2c1f60b84cd39ea32d799333ad1 100644 (file)
@@ -1794,6 +1794,7 @@ simplify_rhs_and_lookup_avail_expr (tree stmt, int insert)
      assignment.  Add minus to this, as we handle it specially below.  */
   if ((associative_tree_code (rhs_code) || rhs_code == MINUS_EXPR)
       && TREE_CODE (TREE_OPERAND (rhs, 0)) == SSA_NAME
+      && num_imm_uses (TREE_OPERAND (rhs, 0)) == 1
       && is_gimple_min_invariant (TREE_OPERAND (rhs, 1)))
     {
       tree rhs_def_stmt = SSA_NAME_DEF_STMT (TREE_OPERAND (rhs, 0));