OSDN Git Service

* dwarf2out.c (loc_list_from_tree): Don't call rtl_for_decl_location
[pf3gnuchains/gcc-fork.git] / gcc / tree-ssa-forwprop.c
index 5aec334..6ba800d 100644 (file)
@@ -831,7 +831,9 @@ forward_propagate_addr_expr_1 (tree name, tree def_rhs,
       && !TYPE_VOLATILE (TREE_TYPE (rhs))
       && !TYPE_VOLATILE (TREE_TYPE (TREE_OPERAND (def_rhs, 0)))
       && operand_equal_p (TYPE_SIZE (TREE_TYPE (rhs)),
-                         TYPE_SIZE (TREE_TYPE (TREE_OPERAND (def_rhs, 0))), 0)) 
+                         TYPE_SIZE (TREE_TYPE (TREE_OPERAND (def_rhs, 0))), 0)
+      /* Make sure we only do TBAA compatible replacements.  */
+      && get_alias_set (TREE_OPERAND (def_rhs, 0)) == get_alias_set (rhs))
    {
      tree def_rhs_base, new_rhs = unshare_expr (TREE_OPERAND (def_rhs, 0));
      new_rhs = fold_build1 (VIEW_CONVERT_EXPR, TREE_TYPE (rhs), new_rhs);
@@ -937,7 +939,6 @@ forward_propagate_addr_expr (tree name, tree rhs)
   gimple use_stmt;
   bool all = true;
   bool single_use_p = has_single_use (name);
-  bool debug = false;
 
   FOR_EACH_IMM_USE_STMT (use_stmt, iter, name)
     {
@@ -948,9 +949,7 @@ forward_propagate_addr_expr (tree name, tree rhs)
         there is nothing we can do.  */
       if (gimple_code (use_stmt) != GIMPLE_ASSIGN)
        {
-         if (is_gimple_debug (use_stmt))
-           debug = true;
-         else
+         if (!is_gimple_debug (use_stmt))
            all = false;
          continue;
        }
@@ -993,9 +992,6 @@ forward_propagate_addr_expr (tree name, tree rhs)
        }
     }
 
-  if (all && debug)
-    propagate_var_def_into_debug_stmts (name, NULL, NULL);
-
   return all;
 }