+2012-08-03  Richard Guenther  <rguenther@suse.de>
+
+       * tree-vect-loop-manip.c (vect_can_advance_ivs_p): Query
+       is_gimple_reg on the SSA name, not its variable.
+       (vect_update_ivs_after_vectorizer): Likewise.
+       * tree-ssa-copyrename.c (rename_ssa_copies): Likewise.
+       * tree-if-conv.c (if_convertible_phi_p): Likewise.
+       (predicate_scalar_phi): Likewise.
+       * tree-vect-loop.c (vect_analyze_scalar_cycles_1): Likewise.
+       (vect_analyze_scalar_cycles_1): Likewise.
+       * tree-ssa-live.c (register_ssa_partition_check): Likewise.
+       * tree-outof-ssa.c (eliminate_useless_phis): Likewise.
+       * tree-ssa-reassoc.c (phi_rank): Likewise.
+       * tree-parloops.c (separate_decls_in_region_name): Use
+       replace_ssa_name_symbol.
+       * tree-predcom.c (base_names_in_chain_on): Likewise.
+       * matrix-reorg.c (update_type_size): Query the type of the SSA name,
+       not its variable.
+       * gimple-ssa-strength-reduction.c (create_mul_ssa_cand): Likewise.
+       (create_mul_imm_cand): Likewise.
+       (create_add_ssa_cand): Likewise.
+       (create_add_imm_cand): Likewise.
+       (slsr_process_add): Likewise.
+       * tree-inline.c (remap_ssa_name): Do not set the type of the
+       new SSA_NAME.
+       * tree-ssa-structalias.c (get_constraint_for_ssa_var): Clarify
+       assert.  Check for default def first.
+
 2012-08-04  Steven Bosscher  <steven@gcc.gnu.org>
 
        * cfgrtl.c (print_rtl_with_bb): Do not print a newline between insns.
 
       base = base_in;
       index = double_int_zero;
       stride = stride_in;
-      ctype = TREE_TYPE (SSA_NAME_VAR (base_in));
+      ctype = TREE_TYPE (base_in);
     }
 
   c = alloc_cand_and_find_basis (CAND_MULT, gs, base, index, stride,
       base = base_in;
       index = double_int_zero;
       stride = stride_in;
-      ctype = TREE_TYPE (SSA_NAME_VAR (base_in));
+      ctype = TREE_TYPE (base_in);
     }
 
   c = alloc_cand_and_find_basis (CAND_MULT, gs, base, index, stride,
          if (subtract_p)
            index = double_int_neg (index);
          stride = addend_cand->base_expr;
-         ctype = TREE_TYPE (SSA_NAME_VAR (base_in));
+         ctype = TREE_TYPE (base_in);
          if (has_single_use (addend_in))
            savings = (addend_cand->dead_savings
                       + stmt_cost (addend_cand->cand_stmt, speed));
                  index = tree_to_double_int (subtrahend_cand->stride);
                  index = double_int_neg (index);
                  stride = subtrahend_cand->base_expr;
-                 ctype = TREE_TYPE (SSA_NAME_VAR (base_in));
+                 ctype = TREE_TYPE (base_in);
                  if (has_single_use (addend_in))
                    savings = (subtrahend_cand->dead_savings 
                               + stmt_cost (subtrahend_cand->cand_stmt, speed));
       base = base_in;
       index = subtract_p ? double_int_minus_one : double_int_one;
       stride = addend_in;
-      ctype = TREE_TYPE (SSA_NAME_VAR (base_in));
+      ctype = TREE_TYPE (base_in);
     }
 
   c = alloc_cand_and_find_basis (CAND_ADD, gs, base, index, stride,
       base = base_in;
       index = index_in;
       stride = integer_one_node;
-      ctype = TREE_TYPE (SSA_NAME_VAR (base_in));
+      ctype = TREE_TYPE (base_in);
     }
 
   c = alloc_cand_and_find_basis (kind, gs, base, index, stride,
       /* First record an interpretation assuming RHS1 is the base expression
         and RHS2 is the stride.  But it doesn't make sense for the
         stride to be a pointer, so don't record a candidate in that case.  */
-      if (!POINTER_TYPE_P (TREE_TYPE (SSA_NAME_VAR (rhs2))))
+      if (!POINTER_TYPE_P (TREE_TYPE (rhs2)))
        {
          c = create_add_ssa_cand (gs, rhs1, rhs2, subtract_p, speed);
 
       /* Otherwise, record another interpretation assuming RHS2 is the
         base expression and RHS1 is the stride, again provided that the
         stride is not a pointer.  */
-      if (!POINTER_TYPE_P (TREE_TYPE (SSA_NAME_VAR (rhs1))))
+      if (!POINTER_TYPE_P (TREE_TYPE (rhs1)))
        {
          c2 = create_add_ssa_cand (gs, rhs2, rhs1, false, speed);
          if (c)
 
     {
       lhs = gimple_assign_lhs (stmt);
       gcc_assert (POINTER_TYPE_P
-                 (TREE_TYPE (SSA_NAME_VAR (TREE_OPERAND (lhs, 0)))));
+                 (TREE_TYPE (TREE_OPERAND (lhs, 0))));
       type_size =
        int_size_in_bytes (TREE_TYPE
-                          (TREE_TYPE
-                           (SSA_NAME_VAR (TREE_OPERAND (lhs, 0)))));
+                          (TREE_TYPE (TREE_OPERAND (lhs, 0))));
     }
   else
     type_size = int_size_in_bytes (TREE_TYPE (ssa_var));
 
   /* When the flag_tree_loop_if_convert_stores is not set, check
      that there are no memory writes in the branches of the loop to be
      if-converted.  */
-  if (!is_gimple_reg (SSA_NAME_VAR (gimple_phi_result (phi))))
+  if (!is_gimple_reg (gimple_phi_result (phi)))
     {
       imm_use_iterator imm_iter;
       use_operand_p use_p;
 
   res = gimple_phi_result (phi);
   /* Do not handle virtual phi nodes.  */
-  if (!is_gimple_reg (SSA_NAME_VAR (res)))
+  if (!is_gimple_reg (res))
     return;
 
   bb = gimple_bb (phi);
 
       insert_decl_map (id, name, new_tree);
       SSA_NAME_OCCURS_IN_ABNORMAL_PHI (new_tree)
        = SSA_NAME_OCCURS_IN_ABNORMAL_PHI (name);
-      TREE_TYPE (new_tree) = TREE_TYPE (SSA_NAME_VAR (new_tree));
       /* At least IPA points-to info can be directly transferred.  */
       if (id->src_cfun->gimple_df
          && id->src_cfun->gimple_df->ipa_pta
 
         {
          gimple phi = gsi_stmt (gsi);
          result = gimple_phi_result (phi);
-         if (!is_gimple_reg (SSA_NAME_VAR (result)))
+         if (!is_gimple_reg (result))
            {
 #ifdef ENABLE_CHECKING
              size_t i;
                {
                  tree arg = PHI_ARG_DEF (phi, i);
                  if (TREE_CODE (arg) == SSA_NAME
-                     && is_gimple_reg (SSA_NAME_VAR (arg)))
+                     && is_gimple_reg (arg))
                    {
                      fprintf (stderr, "Argument of PHI is not virtual (");
                      print_generic_expr (stderr, arg, TDF_SLIM);
 
       copy = name;
     }
 
-  SSA_NAME_VAR (copy) = var_copy;
+  replace_ssa_name_symbol (copy, var_copy);
   return copy;
 }
 
 
   gimple stmt, phi;
   imm_use_iterator iter;
 
-  SSA_NAME_VAR (name) = var;
+  replace_ssa_name_symbol (name, var);
 
   while (1)
     {
        return;
 
       name = PHI_RESULT (phi);
-      SSA_NAME_VAR (name) = var;
+      replace_ssa_name_symbol (name, var);
     }
 }
 
 
          res = gimple_phi_result (phi);
 
          /* Do not process virtual SSA_NAMES.  */
-         if (!is_gimple_reg (SSA_NAME_VAR (res)))
+         if (!is_gimple_reg (res))
            continue;
 
           for (i = 0; i < gimple_phi_num_args (phi); i++)
 
 register_ssa_partition_check (tree ssa_var)
 {
   gcc_assert (TREE_CODE (ssa_var) == SSA_NAME);
-  if (!is_gimple_reg (SSA_NAME_VAR (ssa_var)))
+  if (!is_gimple_reg (ssa_var))
     {
       fprintf (stderr, "Illegally registering a virtual SSA name :");
       print_generic_expr (stderr, ssa_var, TDF_SLIM);
 
 
   /* Ignore virtual SSA_NAMEs.  */
   res = gimple_phi_result (stmt);
-  if (!is_gimple_reg (SSA_NAME_VAR (res)))
+  if (!is_gimple_reg (res))
     return bb_rank[bb->index];
 
   /* The phi definition must have a single use, and that use must be
 
   varinfo_t vi;
 
   /* We allow FUNCTION_DECLs here even though it doesn't make much sense.  */
-  gcc_assert (SSA_VAR_P (t) || DECL_P (t));
+  gcc_assert (TREE_CODE (t) == SSA_NAME || DECL_P (t));
 
   /* For parameters, get at the points-to set for the actual parm
      decl.  */
   if (TREE_CODE (t) == SSA_NAME
+      && SSA_NAME_IS_DEFAULT_DEF (t)
       && (TREE_CODE (SSA_NAME_VAR (t)) == PARM_DECL
-         || TREE_CODE (SSA_NAME_VAR (t)) == RESULT_DECL)
-      && SSA_NAME_IS_DEFAULT_DEF (t))
+         || TREE_CODE (SSA_NAME_VAR (t)) == RESULT_DECL))
     {
       get_constraint_for_ssa_var (SSA_NAME_VAR (t), results, address_p);
       return;
 
       /* Skip virtual phi's. The data dependences that are associated with
          virtual defs/uses (i.e., memory accesses) are analyzed elsewhere.  */
 
-      if (!is_gimple_reg (SSA_NAME_VAR (PHI_RESULT (phi))))
+      if (!is_gimple_reg (PHI_RESULT (phi)))
        {
          if (vect_print_dump_info (REPORT_DETAILS))
            fprintf (vect_dump, "virtual phi. skip.");
         }
 
       /* Skip virtual phi's.  */
-      if (!is_gimple_reg (SSA_NAME_VAR (PHI_RESULT (phi))))
+      if (!is_gimple_reg (PHI_RESULT (phi)))
        {
          if (vect_print_dump_info (REPORT_DETAILS))
            fprintf (vect_dump, "virtual phi. skip.");
 
 
       /* Skip virtual phi's.  The data dependences that are associated with
          virtual defs/uses (i.e., memory accesses) are analyzed elsewhere.  */
-      if (!is_gimple_reg (SSA_NAME_VAR (def)))
+      if (!is_gimple_reg (def))
        continue;
 
       STMT_VINFO_DEF_TYPE (stmt_vinfo) = vect_unknown_def_type;
           print_gimple_stmt (vect_dump, phi, 0, TDF_SLIM);
         }
 
-      gcc_assert (is_gimple_reg (SSA_NAME_VAR (def)));
+      gcc_assert (is_gimple_reg (def));
       gcc_assert (STMT_VINFO_DEF_TYPE (stmt_vinfo) == vect_unknown_def_type);
 
       nested_cycle = (loop != LOOP_VINFO_LOOP (loop_vinfo));