This is the mail archive of the gcc-patches@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]

[PATCH][7/6] Allow anonymous SSA names


This converts most users of create_tmp_{var,reg} to use anonymous
SSA names.  To give you one more reason to look at 6/6 ;)

Bootstrapped on x86_64-unknown-linux-gnu, testing in progress.

Richard.

2012-08-09  Richard Guenther  <rguenther@suse.de>

	* tree-ssa-pre.c (pretemp, storetemp, prephitemp): Remove.
	(need_creation): Remove.
	(get_representative_for): Use anonymous named SSA names.
	(create_expression_by_pieces): Likewise.
	(insert_into_preds_of_block): Likewise.
	(init_pre): Do not init removed vars.
	(fini_pre): Do not free need_creation.
	* tree-ssa-forwprop.c (simplify_bitwise_binary): Use anonymous
	SSA names.
	* tree-ssa-loop-manip.c (create_iv): Likewise.
	* value-prof.c (gimple_divmod_fixed_value): Likewise.
	(gimple_mod_pow2): Likewise.
	(gimple_mod_subtract): Likewise.
	(gimple_ic): Likewise.
	(gimple_stringop_fixed_value): Likewise.
	* tree-ssa-phiopt.c (condstoretemp): Remove.
	(tree_ssa_phiopt_worker): Use anonymous named SSA names.
	(conditional_replacement): Likewise.
	(abs_replacement): Likewise.
	(cond_store_replacement): Likewise.
	(cond_if_else_store_replacement_1): Likewise.
	* tree-ssa-loop-im.c (rewrite_reciprocal): Likewise.
	(rewrite_bittest): Likewise.
	* tree-ssa-reassoc.c (build_and_add_sum): Get type from callers
	and build anonymous SSA names.
	(undistribute_ops_list): Adjust.
	(eliminate_redundant_comparison): Use anonymous SSA names.
	(rewrite_expr_tree_parallel): Likewise.
	(get_reassoc_pow_ssa_name): Remove.
	(attempt_builtin_powi): Adjust.
	(reassociate_bb): Likewise.
	* tree-ssa-strlen.c (get_string_length): Use anonymous SSA names.
	* tree-switch-conversion.c (emit_case_bit_tests): Likewise.
	(build_arrays): Likewise.
	* tree-tailcall.c (adjust_return_value_with_ops): Likewise.
	(create_tailcall_accumulator): Likewise.
	* tree-vect-generic.c (expand_vector_divmod): Likewise.
	* tree-profile.c (gcov_type_tmp_var): Remove.
	(gimple_init_edge_profiler): Do not initialize it and use anonymous
	SSA names.
	(gimple_gen_ic_profiler): Likewise.
	(tree_profiling): Adjust.
	* tree-sra.c (build_ref_for_offset): Use anonymous SSA names.
	* tree-ssa-math-opts.c (execute_cse_sincos_1): Likewise.
	(powi_as_mults_1): Likewise.
	(powi_as_mults): Likewise.
	(build_and_insert_call): Adjust.
	(build_and_insert_binop): Likewise.
	(build_and_insert_ref): Likewise.
	(build_and_insert_cast): Likewise.
	(gimple_expand_builtin_pow): Likewise.
	(gimple_expand_builtin_cabs): Likewise.
	(execute_optimize_bswap): Use anonymous SSA names.
	(convert_mult_to_widen): Likewise.
	(convert_plusminus_to_widen): Likewise.
	* tree-ssa-phiprop.c (phiprop_insert_phi): Likewise.
	* tree-ssa-propagate.c (update_call_from_tree): Likewise.
	* tree-if-conv.c (ifc_temp_var): Likewise.
	* tree-loop-distribution.c (generate_memset_builtin): Likewise.
	* tree-parloops.c (take_address_of): Likewise.
	* tree-vect-data-refs.c (vect_permute_store_chain): Likewise.
	(vect_permute_load_chain): Likewise.
	* tree-vect-loop-manip.c (vect_create_cond_for_align_checks): Likewise.
	* tree-vect-patterns.c (vect_recog_temp_ssa_var): Likewise.
	(vect_handle_widen_op_by_const): Likewise.
	(vect_operation_fits_smaller_type): Likewise.
	(vect_recog_over_widening_pattern): Likewise.
	* tree-vect-stmts.c (vect_init_vector): Likewise.
	* tree-vrp.c (simplify_truth_ops_using_ranges): Likewise.
	(simplify_float_conversion_using_ranges): Likewise.

Index: gcc/tree-ssa-pre.c
===================================================================
*** gcc/tree-ssa-pre.c.orig	2012-08-09 11:02:32.000000000 +0200
--- gcc/tree-ssa-pre.c	2012-08-09 13:31:05.147921660 +0200
*************** static unsigned int get_expr_value_id (p
*** 472,485 ****
  static alloc_pool bitmap_set_pool;
  static bitmap_obstack grand_bitmap_obstack;
  
- /* To avoid adding 300 temporary variables when we only need one, we
-    only create one temporary variable, on demand, and build ssa names
-    off that.  We do have to change the variable if the types don't
-    match the current variable's type.  */
- static tree pretemp;
- static tree storetemp;
- static tree prephitemp;
- 
  /* Set of blocks with statements that have had their EH properties changed.  */
  static bitmap need_eh_cleanup;
  
--- 472,477 ----
*************** get_expr_type (const pre_expr e)
*** 1366,1372 ****
  static tree
  get_representative_for (const pre_expr e)
  {
-   tree exprtype;
    tree name;
    unsigned int value_id = get_expr_value_id (e);
  
--- 1358,1363 ----
*************** get_representative_for (const pre_expr e
*** 1406,1419 ****
        fprintf (dump_file, "\n");
      }
  
-   exprtype = get_expr_type (e);
- 
    /* Build and insert the assignment of the end result to the temporary
       that we will return.  */
!   if (!pretemp || exprtype != TREE_TYPE (pretemp))
!     pretemp = create_tmp_reg (exprtype, "pretmp");
! 
!   name = make_ssa_name (pretemp, gimple_build_nop ());
    VN_INFO_GET (name)->value_id = value_id;
    if (e->kind == CONSTANT)
      VN_INFO (name)->valnum = PRE_EXPR_CONSTANT (e);
--- 1397,1405 ----
        fprintf (dump_file, "\n");
      }
  
    /* Build and insert the assignment of the end result to the temporary
       that we will return.  */
!   name = make_temp_ssa_name (get_expr_type (e), gimple_build_nop (), "pretmp");
    VN_INFO_GET (name)->value_id = value_id;
    if (e->kind == CONSTANT)
      VN_INFO (name)->valnum = PRE_EXPR_CONSTANT (e);
*************** can_PRE_operation (tree op)
*** 2602,2612 ****
     that didn't turn out to be necessary.   */
  static bitmap inserted_exprs;
  
- /* Pool allocated fake store expressions are placed onto this
-    worklist, which, after performing dead code elimination, is walked
-    to see which expressions need to be put into GC'able memory  */
- static VEC(gimple, heap) *need_creation;
- 
  /* The actual worker for create_component_ref_by_pieces.  */
  
  static tree
--- 2588,2593 ----
*************** static tree
*** 2983,2989 ****
  create_expression_by_pieces (basic_block block, pre_expr expr,
  			     gimple_seq *stmts, gimple domstmt, tree type)
  {
!   tree temp, name;
    tree folded;
    gimple_seq forced_stmts = NULL;
    unsigned int value_id;
--- 2964,2970 ----
  create_expression_by_pieces (basic_block block, pre_expr expr,
  			     gimple_seq *stmts, gimple domstmt, tree type)
  {
!   tree name;
    tree folded;
    gimple_seq forced_stmts = NULL;
    unsigned int value_id;
*************** create_expression_by_pieces (basic_block
*** 3101,3116 ****
        gimple_seq_add_seq (stmts, forced_stmts);
      }
  
!   /* Build and insert the assignment of the end result to the temporary
!      that we will return.  */
!   if (!pretemp || exprtype != TREE_TYPE (pretemp))
!     pretemp = create_tmp_reg (exprtype, "pretmp");
! 
!   temp = pretemp;
! 
!   newstmt = gimple_build_assign (temp, folded);
!   name = make_ssa_name (temp, newstmt);
!   gimple_assign_set_lhs (newstmt, name);
    gimple_set_plf (newstmt, NECESSARY, false);
  
    gimple_seq_add_stmt (stmts, newstmt);
--- 3082,3089 ----
        gimple_seq_add_seq (stmts, forced_stmts);
      }
  
!   name = make_temp_ssa_name (exprtype, NULL, "pretmp");
!   newstmt = gimple_build_assign (name, folded);
    gimple_set_plf (newstmt, NECESSARY, false);
  
    gimple_seq_add_stmt (stmts, newstmt);
*************** insert_into_preds_of_block (basic_block
*** 3361,3374 ****
      return false;
  
    /* Now build a phi for the new variable.  */
!   if (!prephitemp || TREE_TYPE (prephitemp) != type)
!     prephitemp = create_tmp_var (type, "prephitmp");
! 
!   temp = prephitemp;
! 
!   if (TREE_CODE (type) == COMPLEX_TYPE
!       || TREE_CODE (type) == VECTOR_TYPE)
!     DECL_GIMPLE_REG_P (temp) = 1;
    phi = create_phi_node (temp, block);
  
    gimple_set_plf (phi, NECESSARY, false);
--- 3334,3340 ----
      return false;
  
    /* Now build a phi for the new variable.  */
!   temp = make_temp_ssa_name (type, NULL, "prephitmp");
    phi = create_phi_node (temp, block);
  
    gimple_set_plf (phi, NECESSARY, false);
*************** init_pre (bool do_fre)
*** 4809,4818 ****
    in_fre = do_fre;
  
    inserted_exprs = BITMAP_ALLOC (NULL);
-   need_creation = NULL;
-   pretemp = NULL_TREE;
-   storetemp = NULL_TREE;
-   prephitemp = NULL_TREE;
  
    connect_infinite_loops_to_exit ();
    memset (&pre_stats, 0, sizeof (pre_stats));
--- 4775,4780 ----
*************** fini_pre (bool do_fre)
*** 4860,4866 ****
    free (postorder);
    VEC_free (bitmap_set_t, heap, value_expressions);
    BITMAP_FREE (inserted_exprs);
-   VEC_free (gimple, heap, need_creation);
    bitmap_obstack_release (&grand_bitmap_obstack);
    free_alloc_pool (bitmap_set_pool);
    free_alloc_pool (pre_expr_pool);
--- 4822,4827 ----
Index: gcc/tree-ssa-forwprop.c
===================================================================
*** gcc/tree-ssa-forwprop.c.orig	2012-08-09 11:02:32.000000000 +0200
--- gcc/tree-ssa-forwprop.c	2012-08-09 13:31:05.149921659 +0200
*************** simplify_bitwise_binary (gimple_stmt_ite
*** 1932,1945 ****
        && int_fits_type_p (arg2, TREE_TYPE (def1_arg1)))
      {
        gimple newop;
!       tree tem = create_tmp_reg (TREE_TYPE (def1_arg1), NULL);
        newop =
          gimple_build_assign_with_ops (code, tem, def1_arg1,
  				      fold_convert_loc (gimple_location (stmt),
  							TREE_TYPE (def1_arg1),
  							arg2));
-       tem = make_ssa_name (tem, newop);
-       gimple_assign_set_lhs (newop, tem);
        gimple_set_location (newop, gimple_location (stmt));
        gsi_insert_before (gsi, newop, GSI_SAME_STMT);
        gimple_assign_set_rhs_with_ops_1 (gsi, NOP_EXPR,
--- 1932,1943 ----
        && int_fits_type_p (arg2, TREE_TYPE (def1_arg1)))
      {
        gimple newop;
!       tree tem = make_ssa_name (TREE_TYPE (def1_arg1), NULL);
        newop =
          gimple_build_assign_with_ops (code, tem, def1_arg1,
  				      fold_convert_loc (gimple_location (stmt),
  							TREE_TYPE (def1_arg1),
  							arg2));
        gimple_set_location (newop, gimple_location (stmt));
        gsi_insert_before (gsi, newop, GSI_SAME_STMT);
        gimple_assign_set_rhs_with_ops_1 (gsi, NOP_EXPR,
*************** simplify_bitwise_binary (gimple_stmt_ite
*** 1965,1975 ****
  	      != GET_MODE_PRECISION (TYPE_MODE (TREE_TYPE (arg1))))))
      {
        gimple newop;
!       tree tem = create_tmp_reg (TREE_TYPE (def1_arg1),
! 				 NULL);
        newop = gimple_build_assign_with_ops (code, tem, def1_arg1, def2_arg1);
-       tem = make_ssa_name (tem, newop);
-       gimple_assign_set_lhs (newop, tem);
        gimple_set_location (newop, gimple_location (stmt));
        gsi_insert_before (gsi, newop, GSI_SAME_STMT);
        gimple_assign_set_rhs_with_ops_1 (gsi, NOP_EXPR,
--- 1963,1970 ----
  	      != GET_MODE_PRECISION (TYPE_MODE (TREE_TYPE (arg1))))))
      {
        gimple newop;
!       tree tem = make_ssa_name (TREE_TYPE (def1_arg1), NULL);
        newop = gimple_build_assign_with_ops (code, tem, def1_arg1, def2_arg1);
        gimple_set_location (newop, gimple_location (stmt));
        gsi_insert_before (gsi, newop, GSI_SAME_STMT);
        gimple_assign_set_rhs_with_ops_1 (gsi, NOP_EXPR,
*************** simplify_bitwise_binary (gimple_stmt_ite
*** 2011,2020 ****
  	{
  	  gimple newop;
  	  tree tem;
! 	  tem = create_tmp_reg (TREE_TYPE (arg2), NULL);
  	  newop = gimple_build_assign_with_ops (code, tem, a, c);
- 	  tem = make_ssa_name (tem, newop);
- 	  gimple_assign_set_lhs (newop, tem);
  	  gimple_set_location (newop, gimple_location (stmt));
  	  /* Make sure to re-process the new stmt as it's walking upwards.  */
  	  gsi_insert_before (gsi, newop, GSI_NEW_STMT);
--- 2006,2013 ----
  	{
  	  gimple newop;
  	  tree tem;
! 	  tem = make_ssa_name (TREE_TYPE (arg2), NULL);
  	  newop = gimple_build_assign_with_ops (code, tem, a, c);
  	  gimple_set_location (newop, gimple_location (stmt));
  	  /* Make sure to re-process the new stmt as it's walking upwards.  */
  	  gsi_insert_before (gsi, newop, GSI_NEW_STMT);
*************** simplify_bitwise_binary (gimple_stmt_ite
*** 2042,2052 ****
  	  update_stmt (stmt);
  	  return true;
  	}
!       tem = create_tmp_reg (TREE_TYPE (arg2), NULL);
        newop = gimple_build_assign_with_ops (BIT_AND_EXPR,
  					    tem, def1_arg1, arg2);
-       tem = make_ssa_name (tem, newop);
-       gimple_assign_set_lhs (newop, tem);
        gimple_set_location (newop, gimple_location (stmt));
        /* Make sure to re-process the new stmt as it's walking upwards.  */
        gsi_insert_before (gsi, newop, GSI_NEW_STMT);
--- 2035,2043 ----
  	  update_stmt (stmt);
  	  return true;
  	}
!       tem = make_ssa_name (TREE_TYPE (arg2), NULL);
        newop = gimple_build_assign_with_ops (BIT_AND_EXPR,
  					    tem, def1_arg1, arg2);
        gimple_set_location (newop, gimple_location (stmt));
        /* Make sure to re-process the new stmt as it's walking upwards.  */
        gsi_insert_before (gsi, newop, GSI_NEW_STMT);
Index: gcc/tree-ssa-loop-manip.c
===================================================================
*** gcc/tree-ssa-loop-manip.c.orig	2012-08-09 13:06:19.000000000 +0200
--- gcc/tree-ssa-loop-manip.c	2012-08-09 13:31:05.150921658 +0200
*************** create_iv (tree base, tree step, tree va
*** 55,67 ****
    enum tree_code incr_op = PLUS_EXPR;
    edge pe = loop_preheader_edge (loop);
  
!   if (!var)
!     var = create_tmp_var (TREE_TYPE (base), "ivtmp");
! 
!   vb = make_ssa_name (var, NULL);
    if (var_before)
      *var_before = vb;
-   va = make_ssa_name (var, NULL);
    if (var_after)
      *var_after = va;
  
--- 55,72 ----
    enum tree_code incr_op = PLUS_EXPR;
    edge pe = loop_preheader_edge (loop);
  
!   if (var != NULL_TREE)
!     {
!       vb = make_ssa_name (var, NULL);
!       va = make_ssa_name (var, NULL);
!     }
!   else
!     {
!       vb = make_temp_ssa_name (TREE_TYPE (base), NULL, "ivtmp");
!       va = make_temp_ssa_name (TREE_TYPE (base), NULL, "ivtmp");
!     }
    if (var_before)
      *var_before = vb;
    if (var_after)
      *var_after = va;
  
Index: gcc/value-prof.c
===================================================================
*** gcc/value-prof.c.orig	2012-08-09 11:02:32.000000000 +0200
--- gcc/value-prof.c	2012-08-09 13:31:05.151921657 +0200
*************** gimple_divmod_fixed_value (gimple stmt,
*** 592,598 ****
  			   gcov_type all)
  {
    gimple stmt1, stmt2, stmt3;
!   tree tmp0, tmp1, tmp2, tmpv;
    gimple bb1end, bb2end, bb3end;
    basic_block bb, bb2, bb3, bb4;
    tree optype, op1, op2;
--- 592,598 ----
  			   gcov_type all)
  {
    gimple stmt1, stmt2, stmt3;
!   tree tmp0, tmp1, tmp2;
    gimple bb1end, bb2end, bb3end;
    basic_block bb, bb2, bb3, bb4;
    tree optype, op1, op2;
*************** gimple_divmod_fixed_value (gimple stmt,
*** 610,622 ****
    bb = gimple_bb (stmt);
    gsi = gsi_for_stmt (stmt);
  
!   tmpv = create_tmp_reg (optype, "PROF");
!   tmp0 = make_ssa_name (tmpv, NULL);
!   tmp1 = make_ssa_name (tmpv, NULL);
    stmt1 = gimple_build_assign (tmp0, fold_convert (optype, value));
-   SSA_NAME_DEF_STMT (tmp0) = stmt1;
    stmt2 = gimple_build_assign (tmp1, op2);
-   SSA_NAME_DEF_STMT (tmp1) = stmt2;
    stmt3 = gimple_build_cond (NE_EXPR, tmp1, tmp0, NULL_TREE, NULL_TREE);
    gsi_insert_before (&gsi, stmt1, GSI_SAME_STMT);
    gsi_insert_before (&gsi, stmt2, GSI_SAME_STMT);
--- 610,619 ----
    bb = gimple_bb (stmt);
    gsi = gsi_for_stmt (stmt);
  
!   tmp0 = make_temp_ssa_name (optype, NULL, "PROF");
!   tmp1 = make_temp_ssa_name (optype, NULL, "PROF");
    stmt1 = gimple_build_assign (tmp0, fold_convert (optype, value));
    stmt2 = gimple_build_assign (tmp1, op2);
    stmt3 = gimple_build_cond (NE_EXPR, tmp1, tmp0, NULL_TREE, NULL_TREE);
    gsi_insert_before (&gsi, stmt1, GSI_SAME_STMT);
    gsi_insert_before (&gsi, stmt2, GSI_SAME_STMT);
*************** static tree
*** 749,755 ****
  gimple_mod_pow2 (gimple stmt, int prob, gcov_type count, gcov_type all)
  {
    gimple stmt1, stmt2, stmt3, stmt4;
!   tree tmp2, tmp3, tmpv;
    gimple bb1end, bb2end, bb3end;
    basic_block bb, bb2, bb3, bb4;
    tree optype, op1, op2;
--- 746,752 ----
  gimple_mod_pow2 (gimple stmt, int prob, gcov_type count, gcov_type all)
  {
    gimple stmt1, stmt2, stmt3, stmt4;
!   tree tmp2, tmp3;
    gimple bb1end, bb2end, bb3end;
    basic_block bb, bb2, bb3, bb4;
    tree optype, op1, op2;
*************** gimple_mod_pow2 (gimple stmt, int prob,
*** 768,781 ****
    gsi = gsi_for_stmt (stmt);
  
    result = create_tmp_reg (optype, "PROF");
!   tmpv = create_tmp_var (optype, "PROF");
!   tmp2 = make_ssa_name (tmpv, NULL);
!   tmp3 = make_ssa_name (tmpv, NULL);
    stmt2 = gimple_build_assign_with_ops (PLUS_EXPR, tmp2, op2,
  					build_int_cst (optype, -1));
-   SSA_NAME_DEF_STMT (tmp2) = stmt2;
    stmt3 = gimple_build_assign_with_ops (BIT_AND_EXPR, tmp3, tmp2, op2);
-   SSA_NAME_DEF_STMT (tmp3) = stmt3;
    stmt4 = gimple_build_cond (NE_EXPR, tmp3, build_int_cst (optype, 0),
  			     NULL_TREE, NULL_TREE);
    gsi_insert_before (&gsi, stmt2, GSI_SAME_STMT);
--- 765,775 ----
    gsi = gsi_for_stmt (stmt);
  
    result = create_tmp_reg (optype, "PROF");
!   tmp2 = make_temp_ssa_name (optype, NULL, "PROF");
!   tmp3 = make_temp_ssa_name (optype, NULL, "PROF");
    stmt2 = gimple_build_assign_with_ops (PLUS_EXPR, tmp2, op2,
  					build_int_cst (optype, -1));
    stmt3 = gimple_build_assign_with_ops (BIT_AND_EXPR, tmp3, tmp2, op2);
    stmt4 = gimple_build_cond (NE_EXPR, tmp3, build_int_cst (optype, 0),
  			     NULL_TREE, NULL_TREE);
    gsi_insert_before (&gsi, stmt2, GSI_SAME_STMT);
*************** gimple_mod_subtract (gimple stmt, int pr
*** 924,933 ****
    gsi = gsi_for_stmt (stmt);
  
    result = create_tmp_reg (optype, "PROF");
!   tmp1 = make_ssa_name (create_tmp_var (optype, "PROF"), NULL);
    stmt1 = gimple_build_assign (result, op1);
    stmt2 = gimple_build_assign (tmp1, op2);
-   SSA_NAME_DEF_STMT (tmp1) = stmt2;
    stmt3 = gimple_build_cond (LT_EXPR, result, tmp1, NULL_TREE, NULL_TREE);
    gsi_insert_before (&gsi, stmt1, GSI_SAME_STMT);
    gsi_insert_before (&gsi, stmt2, GSI_SAME_STMT);
--- 918,926 ----
    gsi = gsi_for_stmt (stmt);
  
    result = create_tmp_reg (optype, "PROF");
!   tmp1 = make_temp_ssa_name (optype, NULL, "PROF");
    stmt1 = gimple_build_assign (result, op1);
    stmt2 = gimple_build_assign (tmp1, op2);
    stmt3 = gimple_build_cond (LT_EXPR, result, tmp1, NULL_TREE, NULL_TREE);
    gsi_insert_before (&gsi, stmt1, GSI_SAME_STMT);
    gsi_insert_before (&gsi, stmt2, GSI_SAME_STMT);
*************** gimple_ic (gimple icall_stmt, struct cgr
*** 1176,1182 ****
  	   int prob, gcov_type count, gcov_type all)
  {
    gimple dcall_stmt, load_stmt, cond_stmt;
!   tree tmp0, tmp1, tmpv, tmp;
    basic_block cond_bb, dcall_bb, icall_bb, join_bb = NULL;
    tree optype = build_pointer_type (void_type_node);
    edge e_cd, e_ci, e_di, e_dj = NULL, e_ij;
--- 1169,1175 ----
  	   int prob, gcov_type count, gcov_type all)
  {
    gimple dcall_stmt, load_stmt, cond_stmt;
!   tree tmp0, tmp1, tmp;
    basic_block cond_bb, dcall_bb, icall_bb, join_bb = NULL;
    tree optype = build_pointer_type (void_type_node);
    edge e_cd, e_ci, e_di, e_dj = NULL, e_ij;
*************** gimple_ic (gimple icall_stmt, struct cgr
*** 1186,1203 ****
    cond_bb = gimple_bb (icall_stmt);
    gsi = gsi_for_stmt (icall_stmt);
  
!   tmpv = create_tmp_reg (optype, "PROF");
!   tmp0 = make_ssa_name (tmpv, NULL);
!   tmp1 = make_ssa_name (tmpv, NULL);
    tmp = unshare_expr (gimple_call_fn (icall_stmt));
    load_stmt = gimple_build_assign (tmp0, tmp);
-   SSA_NAME_DEF_STMT (tmp0) = load_stmt;
    gsi_insert_before (&gsi, load_stmt, GSI_SAME_STMT);
  
    tmp = fold_convert (optype, build_addr (direct_call->symbol.decl,
  					  current_function_decl));
    load_stmt = gimple_build_assign (tmp1, tmp);
-   SSA_NAME_DEF_STMT (tmp1) = load_stmt;
    gsi_insert_before (&gsi, load_stmt, GSI_SAME_STMT);
  
    cond_stmt = gimple_build_cond (EQ_EXPR, tmp1, tmp0, NULL_TREE, NULL_TREE);
--- 1179,1193 ----
    cond_bb = gimple_bb (icall_stmt);
    gsi = gsi_for_stmt (icall_stmt);
  
!   tmp0 = make_temp_ssa_name (optype, NULL, "PROF");
!   tmp1 = make_temp_ssa_name (optype, NULL, "PROF");
    tmp = unshare_expr (gimple_call_fn (icall_stmt));
    load_stmt = gimple_build_assign (tmp0, tmp);
    gsi_insert_before (&gsi, load_stmt, GSI_SAME_STMT);
  
    tmp = fold_convert (optype, build_addr (direct_call->symbol.decl,
  					  current_function_decl));
    load_stmt = gimple_build_assign (tmp1, tmp);
    gsi_insert_before (&gsi, load_stmt, GSI_SAME_STMT);
  
    cond_stmt = gimple_build_cond (EQ_EXPR, tmp1, tmp0, NULL_TREE, NULL_TREE);
*************** gimple_stringop_fixed_value (gimple vcal
*** 1431,1437 ****
  			     gcov_type count, gcov_type all)
  {
    gimple tmp_stmt, cond_stmt, icall_stmt;
!   tree tmp0, tmp1, tmpv, vcall_size, optype;
    basic_block cond_bb, icall_bb, vcall_bb, join_bb;
    edge e_ci, e_cv, e_iv, e_ij, e_vj;
    gimple_stmt_iterator gsi;
--- 1421,1427 ----
  			     gcov_type count, gcov_type all)
  {
    gimple tmp_stmt, cond_stmt, icall_stmt;
!   tree tmp0, tmp1, vcall_size, optype;
    basic_block cond_bb, icall_bb, vcall_bb, join_bb;
    edge e_ci, e_cv, e_iv, e_ij, e_vj;
    gimple_stmt_iterator gsi;
*************** gimple_stringop_fixed_value (gimple vcal
*** 1448,1462 ****
    vcall_size = gimple_call_arg (vcall_stmt, size_arg);
    optype = TREE_TYPE (vcall_size);
  
!   tmpv = create_tmp_var (optype, "PROF");
!   tmp0 = make_ssa_name (tmpv, NULL);
!   tmp1 = make_ssa_name (tmpv, NULL);
    tmp_stmt = gimple_build_assign (tmp0, fold_convert (optype, icall_size));
-   SSA_NAME_DEF_STMT (tmp0) = tmp_stmt;
    gsi_insert_before (&gsi, tmp_stmt, GSI_SAME_STMT);
  
    tmp_stmt = gimple_build_assign (tmp1, vcall_size);
-   SSA_NAME_DEF_STMT (tmp1) = tmp_stmt;
    gsi_insert_before (&gsi, tmp_stmt, GSI_SAME_STMT);
  
    cond_stmt = gimple_build_cond (EQ_EXPR, tmp1, tmp0, NULL_TREE, NULL_TREE);
--- 1438,1449 ----
    vcall_size = gimple_call_arg (vcall_stmt, size_arg);
    optype = TREE_TYPE (vcall_size);
  
!   tmp0 = make_temp_ssa_name (optype, NULL, "PROF");
!   tmp1 = make_temp_ssa_name (optype, NULL, "PROF");
    tmp_stmt = gimple_build_assign (tmp0, fold_convert (optype, icall_size));
    gsi_insert_before (&gsi, tmp_stmt, GSI_SAME_STMT);
  
    tmp_stmt = gimple_build_assign (tmp1, vcall_size);
    gsi_insert_before (&gsi, tmp_stmt, GSI_SAME_STMT);
  
    cond_stmt = gimple_build_cond (EQ_EXPR, tmp1, tmp0, NULL_TREE, NULL_TREE);
Index: gcc/tree-ssa-phiopt.c
===================================================================
*** gcc/tree-ssa-phiopt.c.orig	2012-08-09 11:02:32.000000000 +0200
--- gcc/tree-ssa-phiopt.c	2012-08-09 13:31:05.158921656 +0200
*************** single_non_singleton_phi_for_edges (gimp
*** 272,281 ****
    return phi;
  }
  
- /* For conditional store replacement we need a temporary to
-    put the old contents of the memory in.  */
- static tree condstoretemp;
- 
  /* The core routine of conditional store replacement and normal
     phi optimizations.  Both share much of the infrastructure in how
     to match applicable basic block patterns.  DO_STORE_ELIM is true
--- 272,277 ----
*************** tree_ssa_phiopt_worker (bool do_store_el
*** 292,302 ****
    struct pointer_set_t *nontrap = 0;
  
    if (do_store_elim)
!     {
!       condstoretemp = NULL_TREE;
!       /* Calculate the set of non-trapping memory accesses.  */
!       nontrap = get_non_trapping ();
!     }
  
    /* Search every basic block for COND_EXPR we may be able to optimize.
  
--- 288,295 ----
    struct pointer_set_t *nontrap = 0;
  
    if (do_store_elim)
!     /* Calculate the set of non-trapping memory accesses.  */
!     nontrap = get_non_trapping ();
  
    /* Search every basic block for COND_EXPR we may be able to optimize.
  
*************** conditional_replacement (basic_block con
*** 690,700 ****
      {
        source_location locus_0, locus_1;
  
!       new_var2 = create_tmp_var (TREE_TYPE (result), NULL);
        new_stmt = gimple_build_assign_with_ops (CONVERT_EXPR, new_var2,
  					       new_var, NULL);
-       new_var2 = make_ssa_name (new_var2, new_stmt);
-       gimple_assign_set_lhs (new_stmt, new_var2);
        gsi_insert_before (&gsi, new_stmt, GSI_SAME_STMT);
        new_var = new_var2;
  
--- 683,691 ----
      {
        source_location locus_0, locus_1;
  
!       new_var2 = make_ssa_name (TREE_TYPE (result), NULL);
        new_stmt = gimple_build_assign_with_ops (CONVERT_EXPR, new_var2,
  					       new_var, NULL);
        gsi_insert_before (&gsi, new_stmt, GSI_SAME_STMT);
        new_var = new_var2;
  
*************** abs_replacement (basic_block cond_bb, ba
*** 1212,1221 ****
    result = duplicate_ssa_name (result, NULL);
  
    if (negate)
!     {
!       tree tmp = create_tmp_var (TREE_TYPE (result), NULL);
!       lhs = make_ssa_name (tmp, NULL);
!     }
    else
      lhs = result;
  
--- 1203,1209 ----
    result = duplicate_ssa_name (result, NULL);
  
    if (negate)
!     lhs = make_ssa_name (TREE_TYPE (result), NULL);
    else
      lhs = result;
  
*************** cond_store_replacement (basic_block midd
*** 1445,1451 ****
  			edge e0, edge e1, struct pointer_set_t *nontrap)
  {
    gimple assign = last_and_only_stmt (middle_bb);
!   tree lhs, rhs, name;
    gimple newphi, new_stmt;
    gimple_stmt_iterator gsi;
    source_location locus;
--- 1433,1439 ----
  			edge e0, edge e1, struct pointer_set_t *nontrap)
  {
    gimple assign = last_and_only_stmt (middle_bb);
!   tree lhs, rhs, name, name2;
    gimple newphi, new_stmt;
    gimple_stmt_iterator gsi;
    source_location locus;
*************** cond_store_replacement (basic_block midd
*** 1476,1506 ****
    gsi_remove (&gsi, true);
    release_defs (assign);
  
!   /* 2) Create a temporary where we can store the old content
!         of the memory touched by the store, if we need to.  */
!   if (!condstoretemp || TREE_TYPE (lhs) != TREE_TYPE (condstoretemp))
!     condstoretemp = create_tmp_reg (TREE_TYPE (lhs), "cstore");
! 
!   /* 3) Insert a load from the memory of the store to the temporary
          on the edge which did not contain the store.  */
    lhs = unshare_expr (lhs);
!   new_stmt = gimple_build_assign (condstoretemp, lhs);
!   name = make_ssa_name (condstoretemp, new_stmt);
!   gimple_assign_set_lhs (new_stmt, name);
    gimple_set_location (new_stmt, locus);
    gsi_insert_on_edge (e1, new_stmt);
  
!   /* 4) Create a PHI node at the join block, with one argument
          holding the old RHS, and the other holding the temporary
          where we stored the old memory contents.  */
!   newphi = create_phi_node (condstoretemp, join_bb);
    add_phi_arg (newphi, rhs, e0, locus);
    add_phi_arg (newphi, name, e1, locus);
  
    lhs = unshare_expr (lhs);
    new_stmt = gimple_build_assign (lhs, PHI_RESULT (newphi));
  
!   /* 5) Insert that PHI node.  */
    gsi = gsi_after_labels (join_bb);
    if (gsi_end_p (gsi))
      {
--- 1464,1489 ----
    gsi_remove (&gsi, true);
    release_defs (assign);
  
!   /* 2) Insert a load from the memory of the store to the temporary
          on the edge which did not contain the store.  */
    lhs = unshare_expr (lhs);
!   name = make_temp_ssa_name (TREE_TYPE (lhs), NULL, "cstore");
!   new_stmt = gimple_build_assign (name, lhs);
    gimple_set_location (new_stmt, locus);
    gsi_insert_on_edge (e1, new_stmt);
  
!   /* 3) Create a PHI node at the join block, with one argument
          holding the old RHS, and the other holding the temporary
          where we stored the old memory contents.  */
!   name2 = make_temp_ssa_name (TREE_TYPE (lhs), NULL, "cstore");
!   newphi = create_phi_node (name2, join_bb);
    add_phi_arg (newphi, rhs, e0, locus);
    add_phi_arg (newphi, name, e1, locus);
  
    lhs = unshare_expr (lhs);
    new_stmt = gimple_build_assign (lhs, PHI_RESULT (newphi));
  
!   /* 4) Insert that PHI node.  */
    gsi = gsi_after_labels (join_bb);
    if (gsi_end_p (gsi))
      {
*************** cond_if_else_store_replacement_1 (basic_
*** 1520,1526 ****
  				  basic_block join_bb, gimple then_assign,
  				  gimple else_assign)
  {
!   tree lhs_base, lhs, then_rhs, else_rhs;
    source_location then_locus, else_locus;
    gimple_stmt_iterator gsi;
    gimple newphi, new_stmt;
--- 1503,1509 ----
  				  basic_block join_bb, gimple then_assign,
  				  gimple else_assign)
  {
!   tree lhs_base, lhs, then_rhs, else_rhs, name;
    source_location then_locus, else_locus;
    gimple_stmt_iterator gsi;
    gimple newphi, new_stmt;
*************** cond_if_else_store_replacement_1 (basic_
*** 1560,1580 ****
    gsi_remove (&gsi, true);
    release_defs (else_assign);
  
!   /* 2) Create a temporary where we can store the old content
! 	of the memory touched by the store, if we need to.  */
!   if (!condstoretemp || TREE_TYPE (lhs) != TREE_TYPE (condstoretemp))
!     condstoretemp = create_tmp_reg (TREE_TYPE (lhs), "cstore");
! 
!   /* 3) Create a PHI node at the join block, with one argument
  	holding the old RHS, and the other holding the temporary
  	where we stored the old memory contents.  */
!   newphi = create_phi_node (condstoretemp, join_bb);
    add_phi_arg (newphi, then_rhs, EDGE_SUCC (then_bb, 0), then_locus);
    add_phi_arg (newphi, else_rhs, EDGE_SUCC (else_bb, 0), else_locus);
  
    new_stmt = gimple_build_assign (lhs, PHI_RESULT (newphi));
  
!   /* 4) Insert that PHI node.  */
    gsi = gsi_after_labels (join_bb);
    if (gsi_end_p (gsi))
      {
--- 1543,1559 ----
    gsi_remove (&gsi, true);
    release_defs (else_assign);
  
!   /* 2) Create a PHI node at the join block, with one argument
  	holding the old RHS, and the other holding the temporary
  	where we stored the old memory contents.  */
!   name = make_temp_ssa_name (TREE_TYPE (lhs), NULL, "cstore");
!   newphi = create_phi_node (name, join_bb);
    add_phi_arg (newphi, then_rhs, EDGE_SUCC (then_bb, 0), then_locus);
    add_phi_arg (newphi, else_rhs, EDGE_SUCC (else_bb, 0), else_locus);
  
    new_stmt = gimple_build_assign (lhs, PHI_RESULT (newphi));
  
!   /* 3) Insert that PHI node.  */
    gsi = gsi_after_labels (join_bb);
    if (gsi_end_p (gsi))
      {
Index: gcc/tree-ssa-loop-im.c
===================================================================
*** gcc/tree-ssa-loop-im.c.orig	2012-08-09 13:06:19.000000000 +0200
--- gcc/tree-ssa-loop-im.c	2012-08-09 13:31:05.158921657 +0200
*************** static gimple
*** 934,940 ****
  rewrite_reciprocal (gimple_stmt_iterator *bsi)
  {
    gimple stmt, stmt1, stmt2;
!   tree var, name, lhs, type;
    tree real_one;
    gimple_stmt_iterator gsi;
  
--- 934,940 ----
  rewrite_reciprocal (gimple_stmt_iterator *bsi)
  {
    gimple stmt, stmt1, stmt2;
!   tree name, lhs, type;
    tree real_one;
    gimple_stmt_iterator gsi;
  
*************** rewrite_reciprocal (gimple_stmt_iterator
*** 942,955 ****
    lhs = gimple_assign_lhs (stmt);
    type = TREE_TYPE (lhs);
  
-   var = create_tmp_reg (type, "reciptmp");
- 
    real_one = build_one_cst (type);
  
!   stmt1 = gimple_build_assign_with_ops (RDIV_EXPR,
! 		var, real_one, gimple_assign_rhs2 (stmt));
!   name = make_ssa_name (var, stmt1);
!   gimple_assign_set_lhs (stmt1, name);
  
    stmt2 = gimple_build_assign_with_ops (MULT_EXPR, lhs, name,
  					gimple_assign_rhs1 (stmt));
--- 942,952 ----
    lhs = gimple_assign_lhs (stmt);
    type = TREE_TYPE (lhs);
  
    real_one = build_one_cst (type);
  
!   name = make_temp_ssa_name (type, NULL, "reciptmp");
!   stmt1 = gimple_build_assign_with_ops (RDIV_EXPR, name, real_one,
! 					gimple_assign_rhs2 (stmt));
  
    stmt2 = gimple_build_assign_with_ops (MULT_EXPR, lhs, name,
  					gimple_assign_rhs1 (stmt));
*************** static gimple
*** 972,978 ****
  rewrite_bittest (gimple_stmt_iterator *bsi)
  {
    gimple stmt, use_stmt, stmt1, stmt2;
!   tree lhs, var, name, t, a, b;
    use_operand_p use;
  
    stmt = gsi_stmt (*bsi);
--- 969,975 ----
  rewrite_bittest (gimple_stmt_iterator *bsi)
  {
    gimple stmt, use_stmt, stmt1, stmt2;
!   tree lhs, name, t, a, b;
    use_operand_p use;
  
    stmt = gsi_stmt (*bsi);
*************** rewrite_bittest (gimple_stmt_iterator *b
*** 1021,1038 ****
        gimple_stmt_iterator rsi;
  
        /* 1 << B */
-       var = create_tmp_var (TREE_TYPE (a), "shifttmp");
        t = fold_build2 (LSHIFT_EXPR, TREE_TYPE (a),
  		       build_int_cst (TREE_TYPE (a), 1), b);
!       stmt1 = gimple_build_assign (var, t);
!       name = make_ssa_name (var, stmt1);
!       gimple_assign_set_lhs (stmt1, name);
  
        /* A & (1 << B) */
        t = fold_build2 (BIT_AND_EXPR, TREE_TYPE (a), a, name);
!       stmt2 = gimple_build_assign (var, t);
!       name = make_ssa_name (var, stmt2);
!       gimple_assign_set_lhs (stmt2, name);
  
        /* Replace the SSA_NAME we compare against zero.  Adjust
  	 the type of zero accordingly.  */
--- 1018,1032 ----
        gimple_stmt_iterator rsi;
  
        /* 1 << B */
        t = fold_build2 (LSHIFT_EXPR, TREE_TYPE (a),
  		       build_int_cst (TREE_TYPE (a), 1), b);
!       name = make_temp_ssa_name (TREE_TYPE (a), NULL, "shifttmp");
!       stmt1 = gimple_build_assign (name, t);
  
        /* A & (1 << B) */
        t = fold_build2 (BIT_AND_EXPR, TREE_TYPE (a), a, name);
!       name = make_temp_ssa_name (TREE_TYPE (a), NULL, "shifttmp");
!       stmt2 = gimple_build_assign (name, t);
  
        /* Replace the SSA_NAME we compare against zero.  Adjust
  	 the type of zero accordingly.  */
Index: gcc/tree-ssa-reassoc.c
===================================================================
*** gcc/tree-ssa-reassoc.c.orig	2012-08-09 11:02:32.000000000 +0200
--- gcc/tree-ssa-reassoc.c	2012-08-09 13:31:05.158921657 +0200
*************** zero_one_operation (tree *def, enum tree
*** 1147,1153 ****
     OP1 or OP2.  Returns the new statement.  */
  
  static gimple
! build_and_add_sum (tree tmpvar, tree op1, tree op2, enum tree_code opcode)
  {
    gimple op1def = NULL, op2def = NULL;
    gimple_stmt_iterator gsi;
--- 1147,1153 ----
     OP1 or OP2.  Returns the new statement.  */
  
  static gimple
! build_and_add_sum (tree type, tree op1, tree op2, enum tree_code opcode)
  {
    gimple op1def = NULL, op2def = NULL;
    gimple_stmt_iterator gsi;
*************** build_and_add_sum (tree tmpvar, tree op1
*** 1155,1163 ****
    gimple sum;
  
    /* Create the addition statement.  */
!   sum = gimple_build_assign_with_ops (opcode, tmpvar, op1, op2);
!   op = make_ssa_name (tmpvar, sum);
!   gimple_assign_set_lhs (sum, op);
  
    /* Find an insertion place and insert.  */
    if (TREE_CODE (op1) == SSA_NAME)
--- 1155,1162 ----
    gimple sum;
  
    /* Create the addition statement.  */
!   op = make_ssa_name (type, NULL);
!   sum = gimple_build_assign_with_ops (opcode, op, op1, op2);
  
    /* Find an insertion place and insert.  */
    if (TREE_CODE (op1) == SSA_NAME)
*************** undistribute_ops_list (enum tree_code op
*** 1421,1427 ****
        if (nr_candidates2 >= 2)
  	{
  	  operand_entry_t oe1, oe2;
- 	  tree tmpvar;
  	  gimple prod;
  	  int first = sbitmap_first_set_bit (candidates2);
  
--- 1420,1425 ----
*************** undistribute_ops_list (enum tree_code op
*** 1432,1438 ****
  	      fprintf (dump_file, "Building (");
  	      print_generic_expr (dump_file, oe1->op, 0);
  	    }
- 	  tmpvar = create_tmp_reg (TREE_TYPE (oe1->op), NULL);
  	  zero_one_operation (&oe1->op, c->oecode, c->op);
  	  EXECUTE_IF_SET_IN_SBITMAP (candidates2, first+1, i, sbi0)
  	    {
--- 1430,1435 ----
*************** undistribute_ops_list (enum tree_code op
*** 1444,1457 ****
  		  print_generic_expr (dump_file, oe2->op, 0);
  		}
  	      zero_one_operation (&oe2->op, c->oecode, c->op);
! 	      sum = build_and_add_sum (tmpvar, oe1->op, oe2->op, opcode);
  	      oe2->op = build_zero_cst (TREE_TYPE (oe2->op));
  	      oe2->rank = 0;
  	      oe1->op = gimple_get_lhs (sum);
  	    }
  
  	  /* Apply the multiplication/division.  */
! 	  prod = build_and_add_sum (tmpvar, oe1->op, c->op, c->oecode);
  	  if (dump_file && (dump_flags & TDF_DETAILS))
  	    {
  	      fprintf (dump_file, ") %s ", c->oecode == MULT_EXPR ? "*" : "/");
--- 1441,1456 ----
  		  print_generic_expr (dump_file, oe2->op, 0);
  		}
  	      zero_one_operation (&oe2->op, c->oecode, c->op);
! 	      sum = build_and_add_sum (TREE_TYPE (oe1->op),
! 				       oe1->op, oe2->op, opcode);
  	      oe2->op = build_zero_cst (TREE_TYPE (oe2->op));
  	      oe2->rank = 0;
  	      oe1->op = gimple_get_lhs (sum);
  	    }
  
  	  /* Apply the multiplication/division.  */
! 	  prod = build_and_add_sum (TREE_TYPE (oe1->op),
! 				    oe1->op, c->op, c->oecode);
  	  if (dump_file && (dump_flags & TDF_DETAILS))
  	    {
  	      fprintf (dump_file, ") %s ", c->oecode == MULT_EXPR ? "*" : "/");
*************** eliminate_redundant_comparison (enum tre
*** 1590,1608 ****
  	}
        else if (!operand_equal_p (t, curr->op, 0))
  	{
- 	  tree tmpvar;
  	  gimple sum;
  	  enum tree_code subcode;
  	  tree newop1;
  	  tree newop2;
  	  gcc_assert (COMPARISON_CLASS_P (t));
- 	  tmpvar = create_tmp_var (TREE_TYPE (t), NULL);
  	  extract_ops_from_tree (t, &subcode, &newop1, &newop2);
  	  STRIP_USELESS_TYPE_CONVERSION (newop1);
  	  STRIP_USELESS_TYPE_CONVERSION (newop2);
  	  gcc_checking_assert (is_gimple_val (newop1)
  			       && is_gimple_val (newop2));
! 	  sum = build_and_add_sum (tmpvar, newop1, newop2, subcode);
  	  curr->op = gimple_get_lhs (sum);
  	}
        return true;
--- 1589,1605 ----
  	}
        else if (!operand_equal_p (t, curr->op, 0))
  	{
  	  gimple sum;
  	  enum tree_code subcode;
  	  tree newop1;
  	  tree newop2;
  	  gcc_assert (COMPARISON_CLASS_P (t));
  	  extract_ops_from_tree (t, &subcode, &newop1, &newop2);
  	  STRIP_USELESS_TYPE_CONVERSION (newop1);
  	  STRIP_USELESS_TYPE_CONVERSION (newop2);
  	  gcc_checking_assert (is_gimple_val (newop1)
  			       && is_gimple_val (newop2));
! 	  sum = build_and_add_sum (TREE_TYPE (t), newop1, newop2, subcode);
  	  curr->op = gimple_get_lhs (sum);
  	}
        return true;
*************** rewrite_expr_tree_parallel (gimple stmt,
*** 2442,2448 ****
    int ready_stmts_end = 0;
    int i = 0;
    tree last_rhs1 = gimple_assign_rhs1 (stmt);
-   tree lhs_var;
  
    /* We start expression rewriting from the top statements.
       So, in this loop we create a full list of statements
--- 2439,2444 ----
*************** rewrite_expr_tree_parallel (gimple stmt,
*** 2451,2458 ****
    for (i = stmt_num - 2; i >= 0; i--)
      stmts[i] = SSA_NAME_DEF_STMT (gimple_assign_rhs1 (stmts[i+1]));
  
-   lhs_var = create_tmp_reg (TREE_TYPE (last_rhs1), NULL);
- 
    for (i = 0; i < stmt_num; i++)
      {
        tree op1, op2;
--- 2447,2452 ----
*************** rewrite_expr_tree_parallel (gimple stmt,
*** 2511,2517 ****
  	  update_stmt (stmts[i]);
  	}
        else
! 	stmts[i] = build_and_add_sum (lhs_var, op1, op2, opcode);
  
        if (dump_file && (dump_flags & TDF_DETAILS))
  	{
--- 2505,2511 ----
  	  update_stmt (stmts[i]);
  	}
        else
! 	stmts[i] = build_and_add_sum (TREE_TYPE (last_rhs1), op1, op2, opcode);
  
        if (dump_file && (dump_flags & TDF_DETAILS))
  	{
*************** compare_repeat_factors (const void *x1,
*** 3075,3101 ****
    return rf2->rank - rf1->rank;
  }
  
- /* Get a new SSA name for register variable *TARGET of type TYPE.
-    If *TARGET is null or incompatible with TYPE, create the variable
-    first.  */
- 
- static tree
- get_reassoc_pow_ssa_name (tree *target, tree type)
- {
-   if (!*target || !types_compatible_p (type, TREE_TYPE (*target)))
-     *target = create_tmp_reg (type, "reassocpow");
- 
-   return make_ssa_name (*target, NULL);
- }
- 
  /* Look for repeated operands in OPS in the multiply tree rooted at
     STMT.  Replace them with an optimal sequence of multiplies and powi
     builtin calls, and remove the used operands from OPS.  Return an
     SSA name representing the value of the replacement sequence.  */
  
  static tree
! attempt_builtin_powi (gimple stmt, VEC(operand_entry_t, heap) **ops,
! 		      tree *target)
  {
    unsigned i, j, vec_len;
    int ii;
--- 3069,3081 ----
    return rf2->rank - rf1->rank;
  }
  
  /* Look for repeated operands in OPS in the multiply tree rooted at
     STMT.  Replace them with an optimal sequence of multiplies and powi
     builtin calls, and remove the used operands from OPS.  Return an
     SSA name representing the value of the replacement sequence.  */
  
  static tree
! attempt_builtin_powi (gimple stmt, VEC(operand_entry_t, heap) **ops)
  {
    unsigned i, j, vec_len;
    int ii;
*************** attempt_builtin_powi (gimple stmt, VEC(o
*** 3220,3226 ****
  	    }
  	  else
  	    {
! 	      iter_result = get_reassoc_pow_ssa_name (target, type);
  	      pow_stmt = gimple_build_call (powi_fndecl, 2, rf1->repr, 
  					    build_int_cst (integer_type_node,
  							   power));
--- 3200,3206 ----
  	    }
  	  else
  	    {
! 	      iter_result = make_temp_ssa_name (type, NULL, "reassocpow");
  	      pow_stmt = gimple_build_call (powi_fndecl, 2, rf1->repr, 
  					    build_int_cst (integer_type_node,
  							   power));
*************** attempt_builtin_powi (gimple stmt, VEC(o
*** 3305,3311 ****
  		  op1 = rf1->factor;
  		  op2 = rf2->repr;
  
! 		  target_ssa = get_reassoc_pow_ssa_name (target, type);
  		  mul_stmt = gimple_build_assign_with_ops (MULT_EXPR,
  							   target_ssa,
  							   op1, op2);
--- 3285,3291 ----
  		  op1 = rf1->factor;
  		  op2 = rf2->repr;
  
! 		  target_ssa = make_temp_ssa_name (type, NULL, "reassocpow");
  		  mul_stmt = gimple_build_assign_with_ops (MULT_EXPR,
  							   target_ssa,
  							   op1, op2);
*************** attempt_builtin_powi (gimple stmt, VEC(o
*** 3321,3327 ****
  	  /* Form a call to __builtin_powi for the maximum product
  	     just formed, raised to the power obtained earlier.  */
  	  rf1 = VEC_index (repeat_factor, repeat_factor_vec, j);
! 	  iter_result = get_reassoc_pow_ssa_name (target, type);
  	  pow_stmt = gimple_build_call (powi_fndecl, 2, rf1->repr, 
  					build_int_cst (integer_type_node,
  						       power));
--- 3301,3307 ----
  	  /* Form a call to __builtin_powi for the maximum product
  	     just formed, raised to the power obtained earlier.  */
  	  rf1 = VEC_index (repeat_factor, repeat_factor_vec, j);
! 	  iter_result = make_temp_ssa_name (type, NULL, "reassocpow");
  	  pow_stmt = gimple_build_call (powi_fndecl, 2, rf1->repr, 
  					build_int_cst (integer_type_node,
  						       power));
*************** attempt_builtin_powi (gimple stmt, VEC(o
*** 3334,3340 ****
  	 form the product of this one and those others.  */
        if (result)
  	{
! 	  tree new_result = get_reassoc_pow_ssa_name (target, type);
  	  mul_stmt = gimple_build_assign_with_ops (MULT_EXPR, new_result,
  						   result, iter_result);
  	  gimple_set_location (mul_stmt, gimple_location (stmt));
--- 3314,3320 ----
  	 form the product of this one and those others.  */
        if (result)
  	{
! 	  tree new_result = make_temp_ssa_name (type, NULL, "reassocpow");
  	  mul_stmt = gimple_build_assign_with_ops (MULT_EXPR, new_result,
  						   result, iter_result);
  	  gimple_set_location (mul_stmt, gimple_location (stmt));
*************** reassociate_bb (basic_block bb)
*** 3447,3453 ****
  {
    gimple_stmt_iterator gsi;
    basic_block son;
-   tree target = NULL_TREE;
  
    for (gsi = gsi_last_bb (bb); !gsi_end_p (gsi); gsi_prev (&gsi))
      {
--- 3427,3432 ----
*************** reassociate_bb (basic_block bb)
*** 3533,3539 ****
  	      if (first_pass_instance
  		  && rhs_code == MULT_EXPR
  		  && flag_unsafe_math_optimizations)
! 		powi_result = attempt_builtin_powi (stmt, &ops, &target);
  
  	      /* If the operand vector is now empty, all operands were 
  		 consumed by the __builtin_powi optimization.  */
--- 3512,3518 ----
  	      if (first_pass_instance
  		  && rhs_code == MULT_EXPR
  		  && flag_unsafe_math_optimizations)
! 		powi_result = attempt_builtin_powi (stmt, &ops);
  
  	      /* If the operand vector is now empty, all operands were 
  		 consumed by the __builtin_powi optimization.  */
*************** reassociate_bb (basic_block bb)
*** 3572,3579 ****
  		    {
  		      gimple mul_stmt;
  		      tree type = TREE_TYPE (gimple_get_lhs (stmt));
! 		      tree target_ssa = get_reassoc_pow_ssa_name (&target,
! 								  type);
  		      gimple_set_lhs (stmt, target_ssa);
  		      update_stmt (stmt);
  		      mul_stmt = gimple_build_assign_with_ops (MULT_EXPR, lhs,
--- 3551,3558 ----
  		    {
  		      gimple mul_stmt;
  		      tree type = TREE_TYPE (gimple_get_lhs (stmt));
! 		      tree target_ssa = make_temp_ssa_name (type, NULL,
! 							    "reassocpow");
  		      gimple_set_lhs (stmt, target_ssa);
  		      update_stmt (stmt);
  		      mul_stmt = gimple_build_assign_with_ops (MULT_EXPR, lhs,
Index: gcc/tree-ssa-strlen.c
===================================================================
*** gcc/tree-ssa-strlen.c.orig	2012-08-09 11:02:32.000000000 +0200
--- gcc/tree-ssa-strlen.c	2012-08-09 13:31:05.172921659 +0200
*************** get_string_length (strinfo si)
*** 393,399 ****
    if (si->stmt)
      {
        gimple stmt = si->stmt, lenstmt;
!       tree callee, lhs, lhs_var, fn, tem;
        location_t loc;
        gimple_stmt_iterator gsi;
  
--- 393,399 ----
    if (si->stmt)
      {
        gimple stmt = si->stmt, lenstmt;
!       tree callee, lhs, fn, tem;
        location_t loc;
        gimple_stmt_iterator gsi;
  
*************** get_string_length (strinfo si)
*** 415,429 ****
  	  gsi = gsi_for_stmt (stmt);
  	  fn = builtin_decl_implicit (BUILT_IN_STRLEN);
  	  gcc_assert (lhs == NULL_TREE);
- 	  lhs_var = create_tmp_var (TREE_TYPE (TREE_TYPE (fn)), NULL);
  	  tem = unshare_expr (gimple_call_arg (stmt, 0));
  	  lenstmt = gimple_build_call (fn, 1, tem);
! 	  lhs = make_ssa_name (lhs_var, lenstmt);
  	  gimple_call_set_lhs (lenstmt, lhs);
  	  gimple_set_vuse (lenstmt, gimple_vuse (stmt));
  	  gsi_insert_before (&gsi, lenstmt, GSI_SAME_STMT);
- 	  lhs_var = create_tmp_var (TREE_TYPE (gimple_call_arg (stmt, 0)),
- 				    NULL);
  	  tem = gimple_call_arg (stmt, 0);
            if (!ptrofftype_p (TREE_TYPE (lhs)))
              {
--- 415,426 ----
  	  gsi = gsi_for_stmt (stmt);
  	  fn = builtin_decl_implicit (BUILT_IN_STRLEN);
  	  gcc_assert (lhs == NULL_TREE);
  	  tem = unshare_expr (gimple_call_arg (stmt, 0));
  	  lenstmt = gimple_build_call (fn, 1, tem);
! 	  lhs = make_ssa_name (TREE_TYPE (TREE_TYPE (fn)), lenstmt);
  	  gimple_call_set_lhs (lenstmt, lhs);
  	  gimple_set_vuse (lenstmt, gimple_vuse (stmt));
  	  gsi_insert_before (&gsi, lenstmt, GSI_SAME_STMT);
  	  tem = gimple_call_arg (stmt, 0);
            if (!ptrofftype_p (TREE_TYPE (lhs)))
              {
*************** get_string_length (strinfo si)
*** 432,440 ****
                                                true, GSI_SAME_STMT);
              }
  	  lenstmt
! 	    = gimple_build_assign_with_ops (POINTER_PLUS_EXPR,
! 					    make_ssa_name (lhs_var, NULL),
! 					    tem, lhs);
  	  gsi_insert_before (&gsi, lenstmt, GSI_SAME_STMT);
  	  gimple_call_set_arg (stmt, 0, gimple_assign_lhs (lenstmt));
  	  lhs = NULL_TREE;
--- 429,438 ----
                                                true, GSI_SAME_STMT);
              }
  	  lenstmt
! 	    = gimple_build_assign_with_ops
! 	        (POINTER_PLUS_EXPR,
! 		 make_ssa_name (TREE_TYPE (gimple_call_arg (stmt, 0)), NULL),
! 		 tem, lhs);
  	  gsi_insert_before (&gsi, lenstmt, GSI_SAME_STMT);
  	  gimple_call_set_arg (stmt, 0, gimple_assign_lhs (lenstmt));
  	  lhs = NULL_TREE;
*************** get_string_length (strinfo si)
*** 452,459 ****
  	      print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM);
  	    }
  	  gimple_call_set_fndecl (stmt, fn);
! 	  lhs_var = create_tmp_var (TREE_TYPE (TREE_TYPE (fn)), NULL);
! 	  lhs = make_ssa_name (lhs_var, stmt);
  	  gimple_call_set_lhs (stmt, lhs);
  	  update_stmt (stmt);
  	  if (dump_file && (dump_flags & TDF_DETAILS) != 0)
--- 450,456 ----
  	      print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM);
  	    }
  	  gimple_call_set_fndecl (stmt, fn);
! 	  lhs = make_ssa_name (TREE_TYPE (TREE_TYPE (fn)), stmt);
  	  gimple_call_set_lhs (stmt, lhs);
  	  update_stmt (stmt);
  	  if (dump_file && (dump_flags & TDF_DETAILS) != 0)
Index: gcc/tree-switch-conversion.c
===================================================================
*** gcc/tree-switch-conversion.c.orig	2012-08-09 11:02:32.000000000 +0200
--- gcc/tree-switch-conversion.c	2012-08-09 13:31:05.173921658 +0200
*************** emit_case_bit_tests (gimple swtch, tree
*** 424,438 ****
      }
  
    /* csui = (1 << (word_mode) idx) */
!   tmp = create_tmp_var (word_type_node, "csui");
!   csui = make_ssa_name (tmp, NULL);
    tmp = fold_build2 (LSHIFT_EXPR, word_type_node, word_mode_one,
  		     fold_convert (word_type_node, idx));
    tmp = force_gimple_operand_gsi (&gsi, tmp,
  				  /*simple=*/false, NULL_TREE,
  				  /*before=*/true, GSI_SAME_STMT);
    shift_stmt = gimple_build_assign (csui, tmp);
-   SSA_NAME_DEF_STMT (csui) = shift_stmt;
    gsi_insert_before (&gsi, shift_stmt, GSI_SAME_STMT);
    update_stmt (shift_stmt);
  
--- 424,436 ----
      }
  
    /* csui = (1 << (word_mode) idx) */
!   csui = make_ssa_name (word_type_node, NULL);
    tmp = fold_build2 (LSHIFT_EXPR, word_type_node, word_mode_one,
  		     fold_convert (word_type_node, idx));
    tmp = force_gimple_operand_gsi (&gsi, tmp,
  				  /*simple=*/false, NULL_TREE,
  				  /*before=*/true, GSI_SAME_STMT);
    shift_stmt = gimple_build_assign (csui, tmp);
    gsi_insert_before (&gsi, shift_stmt, GSI_SAME_STMT);
    update_stmt (shift_stmt);
  
*************** static void
*** 1090,1096 ****
  build_arrays (gimple swtch, struct switch_conv_info *info)
  {
    tree arr_index_type;
!   tree tidx, sub, tmp, utype;
    gimple stmt;
    gimple_stmt_iterator gsi;
    int i;
--- 1088,1094 ----
  build_arrays (gimple swtch, struct switch_conv_info *info)
  {
    tree arr_index_type;
!   tree tidx, sub, utype;
    gimple stmt;
    gimple_stmt_iterator gsi;
    int i;
*************** build_arrays (gimple swtch, struct switc
*** 1106,1120 ****
      utype = lang_hooks.types.type_for_mode (TYPE_MODE (utype), 1);
  
    arr_index_type = build_index_type (info->range_size);
!   tmp = create_tmp_var (utype, "csui");
!   tidx = make_ssa_name (tmp, NULL);
    sub = fold_build2_loc (loc, MINUS_EXPR, utype,
  			 fold_convert_loc (loc, utype, info->index_expr),
  			 fold_convert_loc (loc, utype, info->range_min));
    sub = force_gimple_operand_gsi (&gsi, sub,
  				  false, NULL, true, GSI_SAME_STMT);
    stmt = gimple_build_assign (tidx, sub);
-   SSA_NAME_DEF_STMT (tidx) = stmt;
  
    gsi_insert_before (&gsi, stmt, GSI_SAME_STMT);
    update_stmt (stmt);
--- 1104,1116 ----
      utype = lang_hooks.types.type_for_mode (TYPE_MODE (utype), 1);
  
    arr_index_type = build_index_type (info->range_size);
!   tidx = make_ssa_name (utype, NULL);
    sub = fold_build2_loc (loc, MINUS_EXPR, utype,
  			 fold_convert_loc (loc, utype, info->index_expr),
  			 fold_convert_loc (loc, utype, info->range_min));
    sub = force_gimple_operand_gsi (&gsi, sub,
  				  false, NULL, true, GSI_SAME_STMT);
    stmt = gimple_build_assign (tidx, sub);
  
    gsi_insert_before (&gsi, stmt, GSI_SAME_STMT);
    update_stmt (stmt);
Index: gcc/tree-tailcall.c
===================================================================
*** gcc/tree-tailcall.c.orig	2012-08-09 11:02:32.000000000 +0200
--- gcc/tree-tailcall.c	2012-08-09 13:31:05.173921658 +0200
*************** adjust_return_value_with_ops (enum tree_
*** 609,620 ****
  {
  
    tree ret_type = TREE_TYPE (DECL_RESULT (current_function_decl));
!   tree tmp = create_tmp_reg (ret_type, label);
    gimple stmt;
-   tree result;
  
    if (types_compatible_p (TREE_TYPE (acc), TREE_TYPE (op1)))
!     stmt = gimple_build_assign_with_ops (code, tmp, acc, op1);
    else
      {
        tree rhs = fold_convert (TREE_TYPE (acc),
--- 609,619 ----
  {
  
    tree ret_type = TREE_TYPE (DECL_RESULT (current_function_decl));
!   tree result = make_temp_ssa_name (ret_type, NULL, label);
    gimple stmt;
  
    if (types_compatible_p (TREE_TYPE (acc), TREE_TYPE (op1)))
!     stmt = gimple_build_assign_with_ops (code, result, acc, op1);
    else
      {
        tree rhs = fold_convert (TREE_TYPE (acc),
*************** adjust_return_value_with_ops (enum tree_
*** 624,635 ****
  					    op1));
        rhs = force_gimple_operand_gsi (&gsi, rhs,
  				      false, NULL, true, GSI_CONTINUE_LINKING);
!       stmt = gimple_build_assign (NULL_TREE, rhs);
      }
  
-   result = make_ssa_name (tmp, stmt);
-   gimple_assign_set_lhs (stmt, result);
-   update_stmt (stmt);
    gsi_insert_before (&gsi, stmt, GSI_NEW_STMT);
    return result;
  }
--- 623,631 ----
  					    op1));
        rhs = force_gimple_operand_gsi (&gsi, rhs,
  				      false, NULL, true, GSI_CONTINUE_LINKING);
!       stmt = gimple_build_assign (result, rhs);
      }
  
    gsi_insert_before (&gsi, stmt, GSI_NEW_STMT);
    return result;
  }
*************** static tree
*** 904,910 ****
  create_tailcall_accumulator (const char *label, basic_block bb, tree init)
  {
    tree ret_type = TREE_TYPE (DECL_RESULT (current_function_decl));
!   tree tmp = create_tmp_reg (ret_type, label);
    gimple phi;
  
    phi = create_phi_node (tmp, bb);
--- 900,906 ----
  create_tailcall_accumulator (const char *label, basic_block bb, tree init)
  {
    tree ret_type = TREE_TYPE (DECL_RESULT (current_function_decl));
!   tree tmp = make_temp_ssa_name (ret_type, NULL, label);
    gimple phi;
  
    phi = create_phi_node (tmp, bb);
Index: gcc/tree-vect-generic.c
===================================================================
*** gcc/tree-vect-generic.c.orig	2012-08-09 11:02:32.000000000 +0200
--- gcc/tree-vect-generic.c	2012-08-09 13:31:05.174921658 +0200
*************** expand_vector_divmod (gimple_stmt_iterat
*** 667,674 ****
  					((unsigned HOST_WIDE_INT) 1
  					 << shifts[i]) - 1);
  	      cst = build_vector (type, vec);
! 	      addend = create_tmp_reg (type, NULL);
! 	      addend = make_ssa_name (addend, NULL);
  	      stmt = gimple_build_assign_with_ops3 (VEC_COND_EXPR, addend,
  						    cond, cst, zero);
  	      gsi_insert_before (gsi, stmt, GSI_SAME_STMT);
--- 667,673 ----
  					((unsigned HOST_WIDE_INT) 1
  					 << shifts[i]) - 1);
  	      cst = build_vector (type, vec);
! 	      addend = make_ssa_name (type, NULL);
  	      stmt = gimple_build_assign_with_ops3 (VEC_COND_EXPR, addend,
  						    cond, cst, zero);
  	      gsi_insert_before (gsi, stmt, GSI_SAME_STMT);
Index: gcc/tree-profile.c
===================================================================
*** gcc/tree-profile.c.orig	2012-08-09 11:02:32.000000000 +0200
--- gcc/tree-profile.c	2012-08-09 13:31:05.174921658 +0200
*************** along with GCC; see the file COPYING3.
*** 44,50 ****
  #include "target.h"
  
  static GTY(()) tree gcov_type_node;
- static GTY(()) tree gcov_type_tmp_var;
  static GTY(()) tree tree_interval_profiler_fn;
  static GTY(()) tree tree_pow2_profiler_fn;
  static GTY(()) tree tree_one_value_profiler_fn;
--- 44,49 ----
*************** gimple_init_edge_profiler (void)
*** 209,228 ****
  void
  gimple_gen_edge_profiler (int edgeno, edge e)
  {
!   tree ref, one;
    gimple stmt1, stmt2, stmt3;
  
-   /* We share one temporary variable declaration per function.  This
-      gets re-set in tree_profiling.  */
-   if (gcov_type_tmp_var == NULL_TREE)
-     gcov_type_tmp_var = create_tmp_reg (gcov_type_node, "PROF_edge_counter");
    ref = tree_coverage_counter_ref (GCOV_COUNTER_ARCS, edgeno);
    one = build_int_cst (gcov_type_node, 1);
    stmt1 = gimple_build_assign (gcov_type_tmp_var, ref);
!   gimple_assign_set_lhs (stmt1, make_ssa_name (gcov_type_tmp_var, stmt1));
    stmt2 = gimple_build_assign_with_ops (PLUS_EXPR, gcov_type_tmp_var,
  					gimple_assign_lhs (stmt1), one);
-   gimple_assign_set_lhs (stmt2, make_ssa_name (gcov_type_tmp_var, stmt2));
    stmt3 = gimple_build_assign (unshare_expr (ref), gimple_assign_lhs (stmt2));
    gsi_insert_on_edge (e, stmt1);
    gsi_insert_on_edge (e, stmt2);
--- 208,225 ----
  void
  gimple_gen_edge_profiler (int edgeno, edge e)
  {
!   tree ref, one, gcov_type_tmp_var;
    gimple stmt1, stmt2, stmt3;
  
    ref = tree_coverage_counter_ref (GCOV_COUNTER_ARCS, edgeno);
    one = build_int_cst (gcov_type_node, 1);
+   gcov_type_tmp_var = make_temp_ssa_name (gcov_type_node,
+ 					  NULL, "PROF_edge_counter");
    stmt1 = gimple_build_assign (gcov_type_tmp_var, ref);
!   gcov_type_tmp_var = make_temp_ssa_name (gcov_type_node,
! 					  NULL, "PROF_edge_counter");
    stmt2 = gimple_build_assign_with_ops (PLUS_EXPR, gcov_type_tmp_var,
  					gimple_assign_lhs (stmt1), one);
    stmt3 = gimple_build_assign (unshare_expr (ref), gimple_assign_lhs (stmt2));
    gsi_insert_on_edge (e, stmt1);
    gsi_insert_on_edge (e, stmt2);
*************** gimple_gen_ic_profiler (histogram_value
*** 335,344 ****
      stmt3: __gcov_indirect_call_callee = tmp1;
     */
  
-   tmp1 = create_tmp_reg (ptr_void, "PROF");
    stmt1 = gimple_build_assign (ic_gcov_type_ptr_var, ref_ptr);
    stmt2 = gimple_build_assign (tmp1, unshare_expr (value->hvalue.value));
-   gimple_assign_set_lhs (stmt2, make_ssa_name (tmp1, stmt2));
    stmt3 = gimple_build_assign (ic_void_ptr_var, gimple_assign_lhs (stmt2));
  
    gsi_insert_before (&gsi, stmt1, GSI_SAME_STMT);
--- 332,340 ----
      stmt3: __gcov_indirect_call_callee = tmp1;
     */
  
    stmt1 = gimple_build_assign (ic_gcov_type_ptr_var, ref_ptr);
+   tmp1 = make_temp_ssa_name (ptr_void, NULL, "PROF");
    stmt2 = gimple_build_assign (tmp1, unshare_expr (value->hvalue.value));
    stmt3 = gimple_build_assign (ic_void_ptr_var, gimple_assign_lhs (stmt2));
  
    gsi_insert_before (&gsi, stmt1, GSI_SAME_STMT);
*************** tree_profiling (void)
*** 481,489 ****
        push_cfun (DECL_STRUCT_FUNCTION (node->symbol.decl));
        current_function_decl = node->symbol.decl;
  
-       /* Re-set global shared temporary variable for edge-counters.  */
-       gcov_type_tmp_var = NULL_TREE;
- 
        /* Local pure-const may imply need to fixup the cfg.  */
        if (execute_fixup_cfg () & TODO_cleanup_cfg)
  	cleanup_tree_cfg ();
--- 477,482 ----
Index: gcc/tree-sra.c
===================================================================
*** gcc/tree-sra.c.orig	2012-08-09 13:06:19.000000000 +0200
--- gcc/tree-sra.c	2012-08-09 13:31:05.176921656 +0200
*************** build_ref_for_offset (location_t loc, tr
*** 1448,1465 ****
        tree tmp, addr;
  
        gcc_checking_assert (gsi);
!       tmp = create_tmp_reg (build_pointer_type (TREE_TYPE (prev_base)), NULL);
!       tmp = make_ssa_name (tmp, NULL);
        addr = build_fold_addr_expr (unshare_expr (prev_base));
        STRIP_USELESS_TYPE_CONVERSION (addr);
        stmt = gimple_build_assign (tmp, addr);
        gimple_set_location (stmt, loc);
-       SSA_NAME_DEF_STMT (tmp) = stmt;
        if (insert_after)
  	gsi_insert_after (gsi, stmt, GSI_NEW_STMT);
        else
  	gsi_insert_before (gsi, stmt, GSI_SAME_STMT);
-       update_stmt (stmt);
  
        off = build_int_cst (reference_alias_ptr_type (prev_base),
  			   offset / BITS_PER_UNIT);
--- 1448,1462 ----
        tree tmp, addr;
  
        gcc_checking_assert (gsi);
!       tmp = make_ssa_name (build_pointer_type (TREE_TYPE (prev_base)), NULL);
        addr = build_fold_addr_expr (unshare_expr (prev_base));
        STRIP_USELESS_TYPE_CONVERSION (addr);
        stmt = gimple_build_assign (tmp, addr);
        gimple_set_location (stmt, loc);
        if (insert_after)
  	gsi_insert_after (gsi, stmt, GSI_NEW_STMT);
        else
  	gsi_insert_before (gsi, stmt, GSI_SAME_STMT);
  
        off = build_int_cst (reference_alias_ptr_type (prev_base),
  			   offset / BITS_PER_UNIT);
Index: gcc/tree-ssa-math-opts.c
===================================================================
*** gcc/tree-ssa-math-opts.c.orig	2012-08-09 11:02:32.000000000 +0200
--- gcc/tree-ssa-math-opts.c	2012-08-09 14:37:02.061784657 +0200
*************** execute_cse_sincos_1 (tree name)
*** 740,748 ****
    fndecl = mathfn_built_in (type, BUILT_IN_CEXPI);
    if (!fndecl)
      return false;
-   res = create_tmp_reg (TREE_TYPE (TREE_TYPE (fndecl)), "sincostmp");
    stmt = gimple_build_call (fndecl, 1, name);
!   res = make_ssa_name (res, stmt);
    gimple_call_set_lhs (stmt, res);
  
    def_stmt = SSA_NAME_DEF_STMT (name);
--- 740,747 ----
    fndecl = mathfn_built_in (type, BUILT_IN_CEXPI);
    if (!fndecl)
      return false;
    stmt = gimple_build_call (fndecl, 1, name);
!   res = make_temp_ssa_name (TREE_TYPE (TREE_TYPE (fndecl)), stmt, "sincostmp");
    gimple_call_set_lhs (stmt, res);
  
    def_stmt = SSA_NAME_DEF_STMT (name);
*************** execute_cse_sincos_1 (tree name)
*** 758,764 ****
        gsi = gsi_after_labels (top_bb);
        gsi_insert_before (&gsi, stmt, GSI_SAME_STMT);
      }
-   update_stmt (stmt);
    sincos_stats.inserted++;
  
    /* And adjust the recorded old call sites.  */
--- 757,762 ----
*************** powi_cost (HOST_WIDE_INT n)
*** 939,945 ****
  
  static tree
  powi_as_mults_1 (gimple_stmt_iterator *gsi, location_t loc, tree type,
! 		 HOST_WIDE_INT n, tree *cache, tree target)
  {
    tree op0, op1, ssa_target;
    unsigned HOST_WIDE_INT digit;
--- 937,943 ----
  
  static tree
  powi_as_mults_1 (gimple_stmt_iterator *gsi, location_t loc, tree type,
! 		 HOST_WIDE_INT n, tree *cache)
  {
    tree op0, op1, ssa_target;
    unsigned HOST_WIDE_INT digit;
*************** powi_as_mults_1 (gimple_stmt_iterator *g
*** 948,970 ****
    if (n < POWI_TABLE_SIZE && cache[n])
      return cache[n];
  
!   ssa_target = make_ssa_name (target, NULL);
  
    if (n < POWI_TABLE_SIZE)
      {
        cache[n] = ssa_target;
!       op0 = powi_as_mults_1 (gsi, loc, type, n - powi_table[n], cache, target);
!       op1 = powi_as_mults_1 (gsi, loc, type, powi_table[n], cache, target);
      }
    else if (n & 1)
      {
        digit = n & ((1 << POWI_WINDOW_SIZE) - 1);
!       op0 = powi_as_mults_1 (gsi, loc, type, n - digit, cache, target);
!       op1 = powi_as_mults_1 (gsi, loc, type, digit, cache, target);
      }
    else
      {
!       op0 = powi_as_mults_1 (gsi, loc, type, n >> 1, cache, target);
        op1 = op0;
      }
  
--- 946,968 ----
    if (n < POWI_TABLE_SIZE && cache[n])
      return cache[n];
  
!   ssa_target = make_temp_ssa_name (type, NULL, "powmult");
  
    if (n < POWI_TABLE_SIZE)
      {
        cache[n] = ssa_target;
!       op0 = powi_as_mults_1 (gsi, loc, type, n - powi_table[n], cache);
!       op1 = powi_as_mults_1 (gsi, loc, type, powi_table[n], cache);
      }
    else if (n & 1)
      {
        digit = n & ((1 << POWI_WINDOW_SIZE) - 1);
!       op0 = powi_as_mults_1 (gsi, loc, type, n - digit, cache);
!       op1 = powi_as_mults_1 (gsi, loc, type, digit, cache);
      }
    else
      {
!       op0 = powi_as_mults_1 (gsi, loc, type, n >> 1, cache);
        op1 = op0;
      }
  
*************** static tree
*** 982,989 ****
  powi_as_mults (gimple_stmt_iterator *gsi, location_t loc,
  	       tree arg0, HOST_WIDE_INT n)
  {
!   tree cache[POWI_TABLE_SIZE], result, type = TREE_TYPE (arg0), target;
    gimple div_stmt;
  
    if (n == 0)
      return build_real (type, dconst1);
--- 980,988 ----
  powi_as_mults (gimple_stmt_iterator *gsi, location_t loc,
  	       tree arg0, HOST_WIDE_INT n)
  {
!   tree cache[POWI_TABLE_SIZE], result, type = TREE_TYPE (arg0);
    gimple div_stmt;
+   tree target;
  
    if (n == 0)
      return build_real (type, dconst1);
*************** powi_as_mults (gimple_stmt_iterator *gsi
*** 991,1004 ****
    memset (cache, 0,  sizeof (cache));
    cache[1] = arg0;
  
!   target = create_tmp_reg (type, "powmult");
!   result = powi_as_mults_1 (gsi, loc, type, (n < 0) ? -n : n, cache, target);
! 
    if (n >= 0)
      return result;
  
    /* If the original exponent was negative, reciprocate the result.  */
!   target = make_ssa_name (target, NULL);
    div_stmt = gimple_build_assign_with_ops (RDIV_EXPR, target, 
  					   build_real (type, dconst1),
  					   result);
--- 990,1001 ----
    memset (cache, 0,  sizeof (cache));
    cache[1] = arg0;
  
!   result = powi_as_mults_1 (gsi, loc, type, (n < 0) ? -n : n, cache);
    if (n >= 0)
      return result;
  
    /* If the original exponent was negative, reciprocate the result.  */
!   target = make_temp_ssa_name (type, NULL, "powmult");
    div_stmt = gimple_build_assign_with_ops (RDIV_EXPR, target, 
  					   build_real (type, dconst1),
  					   result);
*************** gimple_expand_builtin_powi (gimple_stmt_
*** 1029,1051 ****
  }
  
  /* Build a gimple call statement that calls FN with argument ARG.
!    Set the lhs of the call statement to a fresh SSA name for
!    variable VAR.  If VAR is NULL, first allocate it.  Insert the
     statement prior to GSI's current position, and return the fresh
     SSA name.  */
  
  static tree
  build_and_insert_call (gimple_stmt_iterator *gsi, location_t loc,
! 		       tree *var, tree fn, tree arg)
  {
    gimple call_stmt;
    tree ssa_target;
  
-   if (!*var)
-     *var = create_tmp_reg (TREE_TYPE (arg), "powroot");
- 
    call_stmt = gimple_build_call (fn, 1, arg);
!   ssa_target = make_ssa_name (*var, NULL);
    gimple_set_lhs (call_stmt, ssa_target);
    gimple_set_location (call_stmt, loc);
    gsi_insert_before (gsi, call_stmt, GSI_SAME_STMT);
--- 1026,1044 ----
  }
  
  /* Build a gimple call statement that calls FN with argument ARG.
!    Set the lhs of the call statement to a fresh SSA name.  Insert the
     statement prior to GSI's current position, and return the fresh
     SSA name.  */
  
  static tree
  build_and_insert_call (gimple_stmt_iterator *gsi, location_t loc,
! 		       tree fn, tree arg)
  {
    gimple call_stmt;
    tree ssa_target;
  
    call_stmt = gimple_build_call (fn, 1, arg);
!   ssa_target = make_temp_ssa_name (TREE_TYPE (arg), NULL, "powroot");
    gimple_set_lhs (call_stmt, ssa_target);
    gimple_set_location (call_stmt, loc);
    gsi_insert_before (gsi, call_stmt, GSI_SAME_STMT);
*************** build_and_insert_call (gimple_stmt_itera
*** 1060,1068 ****
  
  static tree
  build_and_insert_binop (gimple_stmt_iterator *gsi, location_t loc,
! 			tree target, enum tree_code code, tree arg0, tree arg1)
  {
!   tree result = make_ssa_name (target, NULL);
    gimple stmt = gimple_build_assign_with_ops (code, result, arg0, arg1);
    gimple_set_location (stmt, loc);
    gsi_insert_before (gsi, stmt, GSI_SAME_STMT);
--- 1053,1062 ----
  
  static tree
  build_and_insert_binop (gimple_stmt_iterator *gsi, location_t loc,
! 			const char *name, enum tree_code code,
! 			tree arg0, tree arg1)
  {
!   tree result = make_temp_ssa_name (TREE_TYPE (arg0), NULL, name);
    gimple stmt = gimple_build_assign_with_ops (code, result, arg0, arg1);
    gimple_set_location (stmt, loc);
    gsi_insert_before (gsi, stmt, GSI_SAME_STMT);
*************** build_and_insert_binop (gimple_stmt_iter
*** 1070,1098 ****
  }
  
  /* Build a gimple reference operation with the given CODE and argument
!    ARG, assigning the result to a new SSA name for variable TARGET.  
     Insert the statement prior to GSI's current position, and return
     the fresh SSA name.  */
  
  static inline tree
  build_and_insert_ref (gimple_stmt_iterator *gsi, location_t loc, tree type,
! 		      tree target, enum tree_code code, tree arg0)
  {
!   tree result = make_ssa_name (target, NULL);
    gimple stmt = gimple_build_assign (result, build1 (code, type, arg0));
    gimple_set_location (stmt, loc);
    gsi_insert_before (gsi, stmt, GSI_SAME_STMT);
    return result;
  }
  
! /* Build a gimple assignment to cast VAL to TARGET.  Insert the statement
     prior to GSI's current position, and return the fresh SSA name.  */
  
  static tree
  build_and_insert_cast (gimple_stmt_iterator *gsi, location_t loc,
! 		       tree target, tree val)
  {
!   return build_and_insert_binop (gsi, loc, target, CONVERT_EXPR, val, NULL);
  }
  
  /* ARG0 and ARG1 are the two arguments to a pow builtin call in GSI
--- 1064,1096 ----
  }
  
  /* Build a gimple reference operation with the given CODE and argument
!    ARG, assigning the result to a new SSA name of TYPE with NAME.
     Insert the statement prior to GSI's current position, and return
     the fresh SSA name.  */
  
  static inline tree
  build_and_insert_ref (gimple_stmt_iterator *gsi, location_t loc, tree type,
! 		      const char *name, enum tree_code code, tree arg0)
  {
!   tree result = make_temp_ssa_name (type, NULL, name);
    gimple stmt = gimple_build_assign (result, build1 (code, type, arg0));
    gimple_set_location (stmt, loc);
    gsi_insert_before (gsi, stmt, GSI_SAME_STMT);
    return result;
  }
  
! /* Build a gimple assignment to cast VAL to TYPE.  Insert the statement
     prior to GSI's current position, and return the fresh SSA name.  */
  
  static tree
  build_and_insert_cast (gimple_stmt_iterator *gsi, location_t loc,
! 		       tree type, tree val)
  {
!   tree result = make_ssa_name (type, NULL);
!   gimple stmt = gimple_build_assign_with_ops (NOP_EXPR, result, val, NULL_TREE);
!   gimple_set_location (stmt, loc);
!   gsi_insert_before (gsi, stmt, GSI_SAME_STMT);
!   return result;
  }
  
  /* ARG0 and ARG1 are the two arguments to a pow builtin call in GSI
*************** gimple_expand_builtin_pow (gimple_stmt_i
*** 1108,1114 ****
    REAL_VALUE_TYPE c2, dconst3;
    HOST_WIDE_INT n;
    tree type, sqrtfn, cbrtfn, sqrt_arg0, sqrt_sqrt, result, cbrt_x, powi_cbrt_x;
-   tree target = NULL_TREE;
    enum machine_mode mode;
    bool hw_sqrt_exists;
  
--- 1106,1111 ----
*************** gimple_expand_builtin_pow (gimple_stmt_i
*** 1141,1147 ****
    if (sqrtfn
        && REAL_VALUES_EQUAL (c, dconsthalf)
        && !HONOR_SIGNED_ZEROS (mode))
!     return build_and_insert_call (gsi, loc, &target, sqrtfn, arg0);
  
    /* Optimize pow(x,0.25) = sqrt(sqrt(x)).  Assume on most machines that
       a builtin sqrt instruction is smaller than a call to pow with 0.25,
--- 1138,1144 ----
    if (sqrtfn
        && REAL_VALUES_EQUAL (c, dconsthalf)
        && !HONOR_SIGNED_ZEROS (mode))
!     return build_and_insert_call (gsi, loc, sqrtfn, arg0);
  
    /* Optimize pow(x,0.25) = sqrt(sqrt(x)).  Assume on most machines that
       a builtin sqrt instruction is smaller than a call to pow with 0.25,
*************** gimple_expand_builtin_pow (gimple_stmt_i
*** 1157,1166 ****
        && hw_sqrt_exists)
      {
        /* sqrt(x)  */
!       sqrt_arg0 = build_and_insert_call (gsi, loc, &target, sqrtfn, arg0);
  
        /* sqrt(sqrt(x))  */
!       return build_and_insert_call (gsi, loc, &target, sqrtfn, sqrt_arg0);
      }
        
    /* Optimize pow(x,0.75) = sqrt(x) * sqrt(sqrt(x)) unless we are
--- 1154,1163 ----
        && hw_sqrt_exists)
      {
        /* sqrt(x)  */
!       sqrt_arg0 = build_and_insert_call (gsi, loc, sqrtfn, arg0);
  
        /* sqrt(sqrt(x))  */
!       return build_and_insert_call (gsi, loc, sqrtfn, sqrt_arg0);
      }
        
    /* Optimize pow(x,0.75) = sqrt(x) * sqrt(sqrt(x)) unless we are
*************** gimple_expand_builtin_pow (gimple_stmt_i
*** 1176,1188 ****
        && hw_sqrt_exists)
      {
        /* sqrt(x)  */
!       sqrt_arg0 = build_and_insert_call (gsi, loc, &target, sqrtfn, arg0);
  
        /* sqrt(sqrt(x))  */
!       sqrt_sqrt = build_and_insert_call (gsi, loc, &target, sqrtfn, sqrt_arg0);
  
        /* sqrt(x) * sqrt(sqrt(x))  */
!       return build_and_insert_binop (gsi, loc, target, MULT_EXPR,
  				     sqrt_arg0, sqrt_sqrt);
      }
  
--- 1173,1185 ----
        && hw_sqrt_exists)
      {
        /* sqrt(x)  */
!       sqrt_arg0 = build_and_insert_call (gsi, loc, sqrtfn, arg0);
  
        /* sqrt(sqrt(x))  */
!       sqrt_sqrt = build_and_insert_call (gsi, loc, sqrtfn, sqrt_arg0);
  
        /* sqrt(x) * sqrt(sqrt(x))  */
!       return build_and_insert_binop (gsi, loc, "powroot", MULT_EXPR,
  				     sqrt_arg0, sqrt_sqrt);
      }
  
*************** gimple_expand_builtin_pow (gimple_stmt_i
*** 1199,1205 ****
        && cbrtfn
        && (gimple_val_nonnegative_real_p (arg0) || !HONOR_NANS (mode))
        && REAL_VALUES_EQUAL (c, dconst1_3))
!     return build_and_insert_call (gsi, loc, &target, cbrtfn, arg0);
    
    /* Optimize pow(x,1./6.) = cbrt(sqrt(x)).  Don't do this optimization
       if we don't have a hardware sqrt insn.  */
--- 1196,1202 ----
        && cbrtfn
        && (gimple_val_nonnegative_real_p (arg0) || !HONOR_NANS (mode))
        && REAL_VALUES_EQUAL (c, dconst1_3))
!     return build_and_insert_call (gsi, loc, cbrtfn, arg0);
    
    /* Optimize pow(x,1./6.) = cbrt(sqrt(x)).  Don't do this optimization
       if we don't have a hardware sqrt insn.  */
*************** gimple_expand_builtin_pow (gimple_stmt_i
*** 1215,1224 ****
        && REAL_VALUES_EQUAL (c, dconst1_6))
      {
        /* sqrt(x)  */
!       sqrt_arg0 = build_and_insert_call (gsi, loc, &target, sqrtfn, arg0);
  
        /* cbrt(sqrt(x))  */
!       return build_and_insert_call (gsi, loc, &target, cbrtfn, sqrt_arg0);
      }
  
    /* Optimize pow(x,c), where n = 2c for some nonzero integer n, into
--- 1212,1221 ----
        && REAL_VALUES_EQUAL (c, dconst1_6))
      {
        /* sqrt(x)  */
!       sqrt_arg0 = build_and_insert_call (gsi, loc, sqrtfn, arg0);
  
        /* cbrt(sqrt(x))  */
!       return build_and_insert_call (gsi, loc, cbrtfn, sqrt_arg0);
      }
  
    /* Optimize pow(x,c), where n = 2c for some nonzero integer n, into
*************** gimple_expand_builtin_pow (gimple_stmt_i
*** 1250,1266 ****
  
        /* Calculate sqrt(x).  When n is not 1 or -1, multiply it by the
  	 result of the optimal multiply sequence just calculated.  */
!       sqrt_arg0 = build_and_insert_call (gsi, loc, &target, sqrtfn, arg0);
  
        if (absu_hwi (n) == 1)
  	result = sqrt_arg0;
        else
! 	result = build_and_insert_binop (gsi, loc, target, MULT_EXPR,
  					 sqrt_arg0, powi_x_ndiv2);
  
        /* If n is negative, reciprocate the result.  */
        if (n < 0)
! 	result = build_and_insert_binop (gsi, loc, target, RDIV_EXPR,
  					 build_real (type, dconst1), result);
        return result;
      }
--- 1247,1263 ----
  
        /* Calculate sqrt(x).  When n is not 1 or -1, multiply it by the
  	 result of the optimal multiply sequence just calculated.  */
!       sqrt_arg0 = build_and_insert_call (gsi, loc, sqrtfn, arg0);
  
        if (absu_hwi (n) == 1)
  	result = sqrt_arg0;
        else
! 	result = build_and_insert_binop (gsi, loc, "powroot", MULT_EXPR,
  					 sqrt_arg0, powi_x_ndiv2);
  
        /* If n is negative, reciprocate the result.  */
        if (n < 0)
! 	result = build_and_insert_binop (gsi, loc, "powroot", RDIV_EXPR,
  					 build_real (type, dconst1), result);
        return result;
      }
*************** gimple_expand_builtin_pow (gimple_stmt_i
*** 1305,1328 ****
        /* Calculate powi(cbrt(x), n%3).  Don't use gimple_expand_builtin_powi
           as that creates an unnecessary variable.  Instead, just produce
           either cbrt(x) or cbrt(x) * cbrt(x).  */
!       cbrt_x = build_and_insert_call (gsi, loc, &target, cbrtfn, arg0);
  
        if (absu_hwi (n) % 3 == 1)
  	powi_cbrt_x = cbrt_x;
        else
! 	powi_cbrt_x = build_and_insert_binop (gsi, loc, target, MULT_EXPR,
  					      cbrt_x, cbrt_x);
  
        /* Multiply the two subexpressions, unless powi(x,abs(n)/3) = 1.  */
        if (absu_hwi (n) < 3)
  	result = powi_cbrt_x;
        else
! 	result = build_and_insert_binop (gsi, loc, target, MULT_EXPR,
  					 powi_x_ndiv3, powi_cbrt_x);
  
        /* If n is negative, reciprocate the result.  */
        if (n < 0)
! 	result = build_and_insert_binop (gsi, loc, target, RDIV_EXPR, 
  					 build_real (type, dconst1), result);
  
        return result;
--- 1302,1325 ----
        /* Calculate powi(cbrt(x), n%3).  Don't use gimple_expand_builtin_powi
           as that creates an unnecessary variable.  Instead, just produce
           either cbrt(x) or cbrt(x) * cbrt(x).  */
!       cbrt_x = build_and_insert_call (gsi, loc, cbrtfn, arg0);
  
        if (absu_hwi (n) % 3 == 1)
  	powi_cbrt_x = cbrt_x;
        else
! 	powi_cbrt_x = build_and_insert_binop (gsi, loc, "powroot", MULT_EXPR,
  					      cbrt_x, cbrt_x);
  
        /* Multiply the two subexpressions, unless powi(x,abs(n)/3) = 1.  */
        if (absu_hwi (n) < 3)
  	result = powi_cbrt_x;
        else
! 	result = build_and_insert_binop (gsi, loc, "powroot", MULT_EXPR,
  					 powi_x_ndiv3, powi_cbrt_x);
  
        /* If n is negative, reciprocate the result.  */
        if (n < 0)
! 	result = build_and_insert_binop (gsi, loc, "powroot", RDIV_EXPR,
  					 build_real (type, dconst1), result);
  
        return result;
*************** gimple_expand_builtin_pow (gimple_stmt_i
*** 1340,1346 ****
  static tree
  gimple_expand_builtin_cabs (gimple_stmt_iterator *gsi, location_t loc, tree arg)
  {
!   tree target, real_part, imag_part, addend1, addend2, sum, result;
    tree type = TREE_TYPE (TREE_TYPE (arg));
    tree sqrtfn = mathfn_built_in (type, BUILT_IN_SQRT);
    enum machine_mode mode = TYPE_MODE (type);
--- 1337,1343 ----
  static tree
  gimple_expand_builtin_cabs (gimple_stmt_iterator *gsi, location_t loc, tree arg)
  {
!   tree real_part, imag_part, addend1, addend2, sum, result;
    tree type = TREE_TYPE (TREE_TYPE (arg));
    tree sqrtfn = mathfn_built_in (type, BUILT_IN_SQRT);
    enum machine_mode mode = TYPE_MODE (type);
*************** gimple_expand_builtin_cabs (gimple_stmt_
*** 1351,1367 ****
        || optab_handler (sqrt_optab, mode) == CODE_FOR_nothing)
      return NULL_TREE;
  
!   target = create_tmp_reg (type, "cabs");
!   real_part = build_and_insert_ref (gsi, loc, type, target,
  				    REALPART_EXPR, arg);
!   addend1 = build_and_insert_binop (gsi, loc, target, MULT_EXPR,
  				    real_part, real_part);
!   imag_part = build_and_insert_ref (gsi, loc, type, target, 
  				    IMAGPART_EXPR, arg);
!   addend2 = build_and_insert_binop (gsi, loc, target, MULT_EXPR,
  				    imag_part, imag_part);
!   sum = build_and_insert_binop (gsi, loc, target, PLUS_EXPR, addend1, addend2);
!   result = build_and_insert_call (gsi, loc, &target, sqrtfn, sum);
  
    return result;
  }
--- 1348,1363 ----
        || optab_handler (sqrt_optab, mode) == CODE_FOR_nothing)
      return NULL_TREE;
  
!   real_part = build_and_insert_ref (gsi, loc, type, "cabs",
  				    REALPART_EXPR, arg);
!   addend1 = build_and_insert_binop (gsi, loc, "cabs", MULT_EXPR,
  				    real_part, real_part);
!   imag_part = build_and_insert_ref (gsi, loc, type, "cabs",
  				    IMAGPART_EXPR, arg);
!   addend2 = build_and_insert_binop (gsi, loc, "cabs", MULT_EXPR,
  				    imag_part, imag_part);
!   sum = build_and_insert_binop (gsi, loc, "cabs", PLUS_EXPR, addend1, addend2);
!   result = build_and_insert_call (gsi, loc, sqrtfn, sum);
  
    return result;
  }
*************** execute_optimize_bswap (void)
*** 1894,1905 ****
  	  if (!useless_type_conversion_p (TREE_TYPE (bswap_tmp), bswap_type))
  	    {
  	      gimple convert_stmt;
! 
! 	      bswap_tmp = create_tmp_var (bswap_type, "bswapsrc");
! 	      bswap_tmp = make_ssa_name (bswap_tmp, NULL);
! 
! 	      convert_stmt = gimple_build_assign_with_ops (
! 			       CONVERT_EXPR, bswap_tmp, bswap_src, NULL);
  	      gsi_insert_before (&gsi, convert_stmt, GSI_SAME_STMT);
  	    }
  
--- 1890,1898 ----
  	  if (!useless_type_conversion_p (TREE_TYPE (bswap_tmp), bswap_type))
  	    {
  	      gimple convert_stmt;
! 	      bswap_tmp = make_temp_ssa_name (bswap_type, NULL, "bswapsrc");
! 	      convert_stmt = gimple_build_assign_with_ops
! 		  		(NOP_EXPR, bswap_tmp, bswap_src, NULL);
  	      gsi_insert_before (&gsi, convert_stmt, GSI_SAME_STMT);
  	    }
  
*************** execute_optimize_bswap (void)
*** 1911,1921 ****
  	  if (!useless_type_conversion_p (TREE_TYPE (bswap_tmp), bswap_type))
  	    {
  	      gimple convert_stmt;
! 
! 	      bswap_tmp = create_tmp_var (bswap_type, "bswapdst");
! 	      bswap_tmp = make_ssa_name (bswap_tmp, NULL);
! 	      convert_stmt = gimple_build_assign_with_ops (
! 		               CONVERT_EXPR, gimple_assign_lhs (stmt), bswap_tmp, NULL);
  	      gsi_insert_after (&gsi, convert_stmt, GSI_SAME_STMT);
  	    }
  
--- 1904,1912 ----
  	  if (!useless_type_conversion_p (TREE_TYPE (bswap_tmp), bswap_type))
  	    {
  	      gimple convert_stmt;
! 	      bswap_tmp = make_temp_ssa_name (bswap_type, NULL, "bswapdst");
! 	      convert_stmt = gimple_build_assign_with_ops
! 			(NOP_EXPR, gimple_assign_lhs (stmt), bswap_tmp, NULL);
  	      gsi_insert_after (&gsi, convert_stmt, GSI_SAME_STMT);
  	    }
  
*************** is_widening_mult_p (gimple stmt,
*** 2092,2098 ****
  static bool
  convert_mult_to_widen (gimple stmt, gimple_stmt_iterator *gsi)
  {
!   tree lhs, rhs1, rhs2, type, type1, type2, tmp = NULL;
    enum insn_code handler;
    enum machine_mode to_mode, from_mode, actual_mode;
    optab op;
--- 2083,2089 ----
  static bool
  convert_mult_to_widen (gimple stmt, gimple_stmt_iterator *gsi)
  {
!   tree lhs, rhs1, rhs2, type, type1, type2;
    enum insn_code handler;
    enum machine_mode to_mode, from_mode, actual_mode;
    optab op;
*************** convert_mult_to_widen (gimple stmt, gimp
*** 2161,2182 ****
      return false;
    if (actual_precision != TYPE_PRECISION (type1)
        || from_unsigned1 != TYPE_UNSIGNED (type1))
!     {
!       tmp = create_tmp_var (build_nonstandard_integer_type
! 				(actual_precision, from_unsigned1),
! 			    NULL);
!       rhs1 = build_and_insert_cast (gsi, loc, tmp, rhs1);
!     }
    if (actual_precision != TYPE_PRECISION (type2)
        || from_unsigned2 != TYPE_UNSIGNED (type2))
!     {
!       /* Reuse the same type info, if possible.  */
!       if (!tmp || from_unsigned1 != from_unsigned2)
! 	tmp = create_tmp_var (build_nonstandard_integer_type
! 				(actual_precision, from_unsigned2),
! 			      NULL);
!       rhs2 = build_and_insert_cast (gsi, loc, tmp, rhs2);
!     }
  
    /* Handle constants.  */
    if (TREE_CODE (rhs1) == INTEGER_CST)
--- 2152,2165 ----
      return false;
    if (actual_precision != TYPE_PRECISION (type1)
        || from_unsigned1 != TYPE_UNSIGNED (type1))
!     rhs1 = build_and_insert_cast (gsi, loc,
! 				  build_nonstandard_integer_type
! 				    (actual_precision, from_unsigned1), rhs1);
    if (actual_precision != TYPE_PRECISION (type2)
        || from_unsigned2 != TYPE_UNSIGNED (type2))
!     rhs2 = build_and_insert_cast (gsi, loc,
! 				  build_nonstandard_integer_type
! 				    (actual_precision, from_unsigned2), rhs2);
  
    /* Handle constants.  */
    if (TREE_CODE (rhs1) == INTEGER_CST)
*************** convert_plusminus_to_widen (gimple_stmt_
*** 2204,2210 ****
  {
    gimple rhs1_stmt = NULL, rhs2_stmt = NULL;
    gimple conv1_stmt = NULL, conv2_stmt = NULL, conv_stmt;
!   tree type, type1, type2, optype, tmp = NULL;
    tree lhs, rhs1, rhs2, mult_rhs1, mult_rhs2, add_rhs;
    enum tree_code rhs1_code = ERROR_MARK, rhs2_code = ERROR_MARK;
    optab this_optab;
--- 2187,2193 ----
  {
    gimple rhs1_stmt = NULL, rhs2_stmt = NULL;
    gimple conv1_stmt = NULL, conv2_stmt = NULL, conv_stmt;
!   tree type, type1, type2, optype;
    tree lhs, rhs1, rhs2, mult_rhs1, mult_rhs2, add_rhs;
    enum tree_code rhs1_code = ERROR_MARK, rhs2_code = ERROR_MARK;
    optab this_optab;
*************** convert_plusminus_to_widen (gimple_stmt_
*** 2373,2397 ****
    actual_precision = GET_MODE_PRECISION (actual_mode);
    if (actual_precision != TYPE_PRECISION (type1)
        || from_unsigned1 != TYPE_UNSIGNED (type1))
!     {
!       tmp = create_tmp_var (build_nonstandard_integer_type
! 				(actual_precision, from_unsigned1),
! 			    NULL);
!       mult_rhs1 = build_and_insert_cast (gsi, loc, tmp, mult_rhs1);
!     }
    if (actual_precision != TYPE_PRECISION (type2)
        || from_unsigned2 != TYPE_UNSIGNED (type2))
!     {
!       if (!tmp || from_unsigned1 != from_unsigned2)
! 	tmp = create_tmp_var (build_nonstandard_integer_type
! 				(actual_precision, from_unsigned2),
! 			      NULL);
!       mult_rhs2 = build_and_insert_cast (gsi, loc, tmp, mult_rhs2);
!     }
  
    if (!useless_type_conversion_p (type, TREE_TYPE (add_rhs)))
!     add_rhs = build_and_insert_cast (gsi, loc, create_tmp_var (type, NULL),
! 				     add_rhs);
  
    /* Handle constants.  */
    if (TREE_CODE (mult_rhs1) == INTEGER_CST)
--- 2356,2374 ----
    actual_precision = GET_MODE_PRECISION (actual_mode);
    if (actual_precision != TYPE_PRECISION (type1)
        || from_unsigned1 != TYPE_UNSIGNED (type1))
!     mult_rhs1 = build_and_insert_cast (gsi, loc,
! 				       build_nonstandard_integer_type
! 				         (actual_precision, from_unsigned1),
! 				       mult_rhs1);
    if (actual_precision != TYPE_PRECISION (type2)
        || from_unsigned2 != TYPE_UNSIGNED (type2))
!     mult_rhs2 = build_and_insert_cast (gsi, loc,
! 				       build_nonstandard_integer_type
! 					 (actual_precision, from_unsigned2),
! 				       mult_rhs2);
  
    if (!useless_type_conversion_p (type, TREE_TYPE (add_rhs)))
!     add_rhs = build_and_insert_cast (gsi, loc, type, add_rhs);
  
    /* Handle constants.  */
    if (TREE_CODE (mult_rhs1) == INTEGER_CST)
Index: gcc/tree-ssa-phiprop.c
===================================================================
*** gcc/tree-ssa-phiprop.c.orig	2012-08-09 11:02:32.000000000 +0200
--- gcc/tree-ssa-phiprop.c	2012-08-09 13:31:05.178921657 +0200
*************** phiprop_insert_phi (basic_block bb, gimp
*** 186,192 ****
  	{
  	  tree rhs = gimple_assign_rhs1 (use_stmt);
  	  gcc_assert (TREE_CODE (old_arg) == ADDR_EXPR);
! 	  new_var = create_tmp_reg (TREE_TYPE (rhs), NULL);
  	  if (!is_gimple_min_invariant (old_arg))
  	    old_arg = PHI_ARG_DEF_FROM_EDGE (phi, e);
  	  else
--- 186,192 ----
  	{
  	  tree rhs = gimple_assign_rhs1 (use_stmt);
  	  gcc_assert (TREE_CODE (old_arg) == ADDR_EXPR);
! 	  new_var = make_ssa_name (TREE_TYPE (rhs), NULL);
  	  if (!is_gimple_min_invariant (old_arg))
  	    old_arg = PHI_ARG_DEF_FROM_EDGE (phi, e);
  	  else
*************** phiprop_insert_phi (basic_block bb, gimp
*** 195,203 ****
  				     fold_build2 (MEM_REF, TREE_TYPE (rhs),
  						  old_arg,
  						  TREE_OPERAND (rhs, 1)));
- 	  gcc_assert (is_gimple_reg (new_var));
- 	  new_var = make_ssa_name (new_var, tmp);
- 	  gimple_assign_set_lhs (tmp, new_var);
  	  gimple_set_location (tmp, locus);
  
  	  gsi_insert_on_edge (e, tmp);
--- 195,200 ----
Index: gcc/tree-ssa-propagate.c
===================================================================
*** gcc/tree-ssa-propagate.c.orig	2012-08-09 11:02:32.000000000 +0200
--- gcc/tree-ssa-propagate.c	2012-08-09 13:31:05.178921657 +0200
*************** update_call_from_tree (gimple_stmt_itera
*** 791,801 ****
               variable.  Create an assignment statement
               with a dummy (unused) lhs variable.  */
            STRIP_USELESS_TYPE_CONVERSION (expr);
-           lhs = create_tmp_var (TREE_TYPE (expr), NULL);
-           new_stmt = gimple_build_assign (lhs, expr);
  	  if (gimple_in_ssa_p (cfun))
! 	    lhs = make_ssa_name (lhs, new_stmt);
!           gimple_assign_set_lhs (new_stmt, lhs);
  	  gimple_set_vuse (new_stmt, gimple_vuse (stmt));
  	  gimple_set_vdef (new_stmt, gimple_vdef (stmt));
            move_ssa_defining_stmt_for_defs (new_stmt, stmt);
--- 791,801 ----
               variable.  Create an assignment statement
               with a dummy (unused) lhs variable.  */
            STRIP_USELESS_TYPE_CONVERSION (expr);
  	  if (gimple_in_ssa_p (cfun))
! 	    lhs = make_ssa_name (TREE_TYPE (expr), NULL);
! 	  else
! 	    lhs = create_tmp_var (TREE_TYPE (expr), NULL);
!           new_stmt = gimple_build_assign (lhs, expr);
  	  gimple_set_vuse (new_stmt, gimple_vuse (stmt));
  	  gimple_set_vdef (new_stmt, gimple_vdef (stmt));
            move_ssa_defining_stmt_for_defs (new_stmt, stmt);
Index: gcc/tree-if-conv.c
===================================================================
*** gcc/tree-if-conv.c.orig	2012-08-03 10:54:00.000000000 +0200
--- gcc/tree-if-conv.c	2012-08-09 13:56:58.901867884 +0200
*************** reset_bb_predicate (basic_block bb)
*** 221,245 ****
  static tree
  ifc_temp_var (tree type, tree expr, gimple_stmt_iterator *gsi)
  {
!   const char *name = "_ifc_";
!   tree var, new_name;
!   gimple stmt;
! 
!   /* Create new temporary variable.  */
!   var = create_tmp_var (type, name);
! 
!   /* Build new statement to assign EXPR to new variable.  */
!   stmt = gimple_build_assign (var, expr);
! 
!   /* Get SSA name for the new variable and set make new statement
!      its definition statement.  */
!   new_name = make_ssa_name (var, stmt);
!   gimple_assign_set_lhs (stmt, new_name);
!   SSA_NAME_DEF_STMT (new_name) = stmt;
!   update_stmt (stmt);
! 
    gsi_insert_before (gsi, stmt, GSI_SAME_STMT);
!   return gimple_assign_lhs (stmt);
  }
  
  /* Return true when COND is a true predicate.  */
--- 221,230 ----
  static tree
  ifc_temp_var (tree type, tree expr, gimple_stmt_iterator *gsi)
  {
!   tree new_name = make_temp_ssa_name (type, NULL, "_ifc_");
!   gimple stmt = gimple_build_assign (new_name, expr);
    gsi_insert_before (gsi, stmt, GSI_SAME_STMT);
!   return new_name;
  }
  
  /* Return true when COND is a true predicate.  */
Index: gcc/tree-loop-distribution.c
===================================================================
*** gcc/tree-loop-distribution.c.orig	2012-08-01 13:47:13.000000000 +0200
--- gcc/tree-loop-distribution.c	2012-08-09 13:53:35.326875007 +0200
*************** generate_memset_builtin (struct loop *lo
*** 391,398 ****
        else if (!useless_type_conversion_p (integer_type_node, TREE_TYPE (val)))
  	{
  	  gimple cstmt;
! 	  tree tem = create_tmp_reg (integer_type_node, NULL);
! 	  tem = make_ssa_name (tem, NULL);
  	  cstmt = gimple_build_assign_with_ops (NOP_EXPR, tem, val, NULL_TREE);
  	  gsi_insert_after (&gsi, cstmt, GSI_CONTINUE_LINKING);
  	  val = tem;
--- 391,397 ----
        else if (!useless_type_conversion_p (integer_type_node, TREE_TYPE (val)))
  	{
  	  gimple cstmt;
! 	  tree tem = make_ssa_name (integer_type_node, NULL);
  	  cstmt = gimple_build_assign_with_ops (NOP_EXPR, tem, val, NULL_TREE);
  	  gsi_insert_after (&gsi, cstmt, GSI_CONTINUE_LINKING);
  	  val = tem;
Index: gcc/tree-parloops.c
===================================================================
*** gcc/tree-parloops.c.orig	2012-08-09 13:52:10.000000000 +0200
--- gcc/tree-parloops.c	2012-08-09 13:52:17.137877613 +0200
*************** take_address_of (tree obj, tree type, ed
*** 452,458 ****
    int uid;
    void **dslot;
    struct int_tree_map ielt, *nielt;
!   tree *var_p, name, bvar, addr;
    gimple stmt;
    gimple_seq stmts;
  
--- 452,458 ----
    int uid;
    void **dslot;
    struct int_tree_map ielt, *nielt;
!   tree *var_p, name, addr;
    gimple stmt;
    gimple_seq stmts;
  
*************** take_address_of (tree obj, tree type, ed
*** 479,490 ****
        if (gsi == NULL)
  	return NULL;
        addr = TREE_OPERAND (*var_p, 0);
!       bvar = create_tmp_var (TREE_TYPE (addr),
! 			     get_name (TREE_OPERAND
! 				         (TREE_OPERAND (*var_p, 0), 0)));
!       stmt = gimple_build_assign (bvar, addr);
!       name = make_ssa_name (bvar, stmt);
!       gimple_assign_set_lhs (stmt, name);
        gsi_insert_on_edge_immediate (entry, stmt);
  
        nielt = XNEW (struct int_tree_map);
--- 479,488 ----
        if (gsi == NULL)
  	return NULL;
        addr = TREE_OPERAND (*var_p, 0);
!       name = make_temp_ssa_name (TREE_TYPE (addr), NULL,
! 				 get_name (TREE_OPERAND
! 					   (TREE_OPERAND (*var_p, 0), 0)));
!       stmt = gimple_build_assign (name, addr);
        gsi_insert_on_edge_immediate (entry, stmt);
  
        nielt = XNEW (struct int_tree_map);
Index: gcc/tree-vect-data-refs.c
===================================================================
*** gcc/tree-vect-data-refs.c.orig	2012-08-07 16:30:56.000000000 +0200
--- gcc/tree-vect-data-refs.c	2012-08-09 13:46:35.213889446 +0200
*************** vect_permute_store_chain (VEC(tree,heap)
*** 4129,4135 ****
  			  gimple_stmt_iterator *gsi,
  			  VEC(tree,heap) **result_chain)
  {
!   tree perm_dest, vect1, vect2, high, low;
    gimple perm_stmt;
    tree vectype = STMT_VINFO_VECTYPE (vinfo_for_stmt (stmt));
    tree perm_mask_low, perm_mask_high;
--- 4129,4135 ----
  			  gimple_stmt_iterator *gsi,
  			  VEC(tree,heap) **result_chain)
  {
!   tree vect1, vect2, high, low;
    gimple perm_stmt;
    tree vectype = STMT_VINFO_VECTYPE (vinfo_for_stmt (stmt));
    tree perm_mask_low, perm_mask_high;
*************** vect_permute_store_chain (VEC(tree,heap)
*** 4161,4168 ****
  
  	  /* Create interleaving stmt:
  	     high = VEC_PERM_EXPR <vect1, vect2, {0, nelt, 1, nelt+1, ...}>  */
! 	  perm_dest = create_tmp_reg (vectype, "vect_inter_high");
! 	  high = make_ssa_name (perm_dest, NULL);
  	  perm_stmt
  	    = gimple_build_assign_with_ops3 (VEC_PERM_EXPR, high,
  					     vect1, vect2, perm_mask_high);
--- 4161,4167 ----
  
  	  /* Create interleaving stmt:
  	     high = VEC_PERM_EXPR <vect1, vect2, {0, nelt, 1, nelt+1, ...}>  */
! 	  high = make_temp_ssa_name (vectype, NULL, "vect_inter_high");
  	  perm_stmt
  	    = gimple_build_assign_with_ops3 (VEC_PERM_EXPR, high,
  					     vect1, vect2, perm_mask_high);
*************** vect_permute_store_chain (VEC(tree,heap)
*** 4172,4179 ****
  	  /* Create interleaving stmt:
  	     low = VEC_PERM_EXPR <vect1, vect2, {nelt/2, nelt*3/2, nelt/2+1,
  						 nelt*3/2+1, ...}>  */
! 	  perm_dest = create_tmp_reg (vectype, "vect_inter_low");
! 	  low = make_ssa_name (perm_dest, NULL);
  	  perm_stmt
  	    = gimple_build_assign_with_ops3 (VEC_PERM_EXPR, low,
  					     vect1, vect2, perm_mask_low);
--- 4171,4177 ----
  	  /* Create interleaving stmt:
  	     low = VEC_PERM_EXPR <vect1, vect2, {nelt/2, nelt*3/2, nelt/2+1,
  						 nelt*3/2+1, ...}>  */
! 	  low = make_temp_ssa_name (vectype, NULL, "vect_inter_low");
  	  perm_stmt
  	    = gimple_build_assign_with_ops3 (VEC_PERM_EXPR, low,
  					     vect1, vect2, perm_mask_low);
*************** vect_permute_load_chain (VEC(tree,heap)
*** 4584,4590 ****
  			 gimple_stmt_iterator *gsi,
  			 VEC(tree,heap) **result_chain)
  {
!   tree perm_dest, data_ref, first_vect, second_vect;
    tree perm_mask_even, perm_mask_odd;
    gimple perm_stmt;
    tree vectype = STMT_VINFO_VECTYPE (vinfo_for_stmt (stmt));
--- 4582,4588 ----
  			 gimple_stmt_iterator *gsi,
  			 VEC(tree,heap) **result_chain)
  {
!   tree data_ref, first_vect, second_vect;
    tree perm_mask_even, perm_mask_odd;
    gimple perm_stmt;
    tree vectype = STMT_VINFO_VECTYPE (vinfo_for_stmt (stmt));
*************** vect_permute_load_chain (VEC(tree,heap)
*** 4612,4640 ****
  	  second_vect = VEC_index (tree, dr_chain, j+1);
  
  	  /* data_ref = permute_even (first_data_ref, second_data_ref);  */
! 	  perm_dest = create_tmp_reg (vectype, "vect_perm_even");
! 
! 	  perm_stmt = gimple_build_assign_with_ops3 (VEC_PERM_EXPR, perm_dest,
  						     first_vect, second_vect,
  						     perm_mask_even);
- 
- 	  data_ref = make_ssa_name (perm_dest, perm_stmt);
- 	  gimple_assign_set_lhs (perm_stmt, data_ref);
  	  vect_finish_stmt_generation (stmt, perm_stmt, gsi);
- 
  	  VEC_replace (tree, *result_chain, j/2, data_ref);
  
  	  /* data_ref = permute_odd (first_data_ref, second_data_ref);  */
! 	  perm_dest = create_tmp_reg (vectype, "vect_perm_odd");
! 
! 	  perm_stmt = gimple_build_assign_with_ops3 (VEC_PERM_EXPR, perm_dest,
  						     first_vect, second_vect,
  						     perm_mask_odd);
- 
- 	  data_ref = make_ssa_name (perm_dest, perm_stmt);
- 	  gimple_assign_set_lhs (perm_stmt, data_ref);
  	  vect_finish_stmt_generation (stmt, perm_stmt, gsi);
- 
  	  VEC_replace (tree, *result_chain, j/2+length/2, data_ref);
  	}
        dr_chain = VEC_copy (tree, heap, *result_chain);
--- 4610,4628 ----
  	  second_vect = VEC_index (tree, dr_chain, j+1);
  
  	  /* data_ref = permute_even (first_data_ref, second_data_ref);  */
! 	  data_ref = make_temp_ssa_name (vectype, NULL, "vect_perm_even");
! 	  perm_stmt = gimple_build_assign_with_ops3 (VEC_PERM_EXPR, data_ref,
  						     first_vect, second_vect,
  						     perm_mask_even);
  	  vect_finish_stmt_generation (stmt, perm_stmt, gsi);
  	  VEC_replace (tree, *result_chain, j/2, data_ref);
  
  	  /* data_ref = permute_odd (first_data_ref, second_data_ref);  */
! 	  data_ref = make_temp_ssa_name (vectype, NULL, "vect_perm_odd");
! 	  perm_stmt = gimple_build_assign_with_ops3 (VEC_PERM_EXPR, data_ref,
  						     first_vect, second_vect,
  						     perm_mask_odd);
  	  vect_finish_stmt_generation (stmt, perm_stmt, gsi);
  	  VEC_replace (tree, *result_chain, j/2+length/2, data_ref);
  	}
        dr_chain = VEC_copy (tree, heap, *result_chain);
Index: gcc/tree-vect-loop-manip.c
===================================================================
*** gcc/tree-vect-loop-manip.c.orig	2012-08-08 16:49:46.000000000 +0200
--- gcc/tree-vect-loop-manip.c	2012-08-09 13:41:23.030900260 +0200
*************** vect_create_cond_for_align_checks (loop_
*** 2213,2219 ****
    tree int_ptrsize_type;
    char tmp_name[20];
    tree or_tmp_name = NULL_TREE;
!   tree and_tmp, and_tmp_name;
    gimple and_stmt;
    tree ptrsize_zero;
    tree part_cond_expr;
--- 2213,2219 ----
    tree int_ptrsize_type;
    char tmp_name[20];
    tree or_tmp_name = NULL_TREE;
!   tree and_tmp_name;
    gimple and_stmt;
    tree ptrsize_zero;
    tree part_cond_expr;
*************** vect_create_cond_for_align_checks (loop_
*** 2231,2238 ****
      {
        gimple_seq new_stmt_list = NULL;
        tree addr_base;
!       tree addr_tmp, addr_tmp_name;
!       tree or_tmp, new_or_tmp_name;
        gimple addr_stmt, or_stmt;
        stmt_vec_info stmt_vinfo = vinfo_for_stmt (ref_stmt);
        tree vectype = STMT_VINFO_VECTYPE (stmt_vinfo);
--- 2231,2238 ----
      {
        gimple_seq new_stmt_list = NULL;
        tree addr_base;
!       tree addr_tmp_name;
!       tree new_or_tmp_name;
        gimple addr_stmt, or_stmt;
        stmt_vec_info stmt_vinfo = vinfo_for_stmt (ref_stmt);
        tree vectype = STMT_VINFO_VECTYPE (stmt_vinfo);
*************** vect_create_cond_for_align_checks (loop_
*** 2248,2259 ****
        if (new_stmt_list != NULL)
  	gimple_seq_add_seq (cond_expr_stmt_list, new_stmt_list);
  
!       sprintf (tmp_name, "%s%d", "addr2int", i);
!       addr_tmp = create_tmp_reg (int_ptrsize_type, tmp_name);
!       addr_tmp_name = make_ssa_name (addr_tmp, NULL);
        addr_stmt = gimple_build_assign_with_ops (NOP_EXPR, addr_tmp_name,
  						addr_base, NULL_TREE);
-       SSA_NAME_DEF_STMT (addr_tmp_name) = addr_stmt;
        gimple_seq_add_stmt (cond_expr_stmt_list, addr_stmt);
  
        /* The addresses are OR together.  */
--- 2248,2257 ----
        if (new_stmt_list != NULL)
  	gimple_seq_add_seq (cond_expr_stmt_list, new_stmt_list);
  
!       sprintf (tmp_name, "addr2int%d", i);
!       addr_tmp_name = make_temp_ssa_name (int_ptrsize_type, NULL, tmp_name);
        addr_stmt = gimple_build_assign_with_ops (NOP_EXPR, addr_tmp_name,
  						addr_base, NULL_TREE);
        gimple_seq_add_stmt (cond_expr_stmt_list, addr_stmt);
  
        /* The addresses are OR together.  */
*************** vect_create_cond_for_align_checks (loop_
*** 2261,2273 ****
        if (or_tmp_name != NULL_TREE)
          {
            /* create: or_tmp = or_tmp | addr_tmp */
!           sprintf (tmp_name, "%s%d", "orptrs", i);
!           or_tmp = create_tmp_reg (int_ptrsize_type, tmp_name);
! 	  new_or_tmp_name = make_ssa_name (or_tmp, NULL);
  	  or_stmt = gimple_build_assign_with_ops (BIT_IOR_EXPR,
  						  new_or_tmp_name,
  						  or_tmp_name, addr_tmp_name);
-           SSA_NAME_DEF_STMT (new_or_tmp_name) = or_stmt;
  	  gimple_seq_add_stmt (cond_expr_stmt_list, or_stmt);
            or_tmp_name = new_or_tmp_name;
          }
--- 2259,2269 ----
        if (or_tmp_name != NULL_TREE)
          {
            /* create: or_tmp = or_tmp | addr_tmp */
!           sprintf (tmp_name, "orptrs%d", i);
! 	  new_or_tmp_name = make_temp_ssa_name (int_ptrsize_type, NULL, tmp_name);
  	  or_stmt = gimple_build_assign_with_ops (BIT_IOR_EXPR,
  						  new_or_tmp_name,
  						  or_tmp_name, addr_tmp_name);
  	  gimple_seq_add_stmt (cond_expr_stmt_list, or_stmt);
            or_tmp_name = new_or_tmp_name;
          }
*************** vect_create_cond_for_align_checks (loop_
*** 2279,2290 ****
    mask_cst = build_int_cst (int_ptrsize_type, mask);
  
    /* create: and_tmp = or_tmp & mask  */
!   and_tmp = create_tmp_reg (int_ptrsize_type, "andmask" );
!   and_tmp_name = make_ssa_name (and_tmp, NULL);
  
    and_stmt = gimple_build_assign_with_ops (BIT_AND_EXPR, and_tmp_name,
  					   or_tmp_name, mask_cst);
-   SSA_NAME_DEF_STMT (and_tmp_name) = and_stmt;
    gimple_seq_add_stmt (cond_expr_stmt_list, and_stmt);
  
    /* Make and_tmp the left operand of the conditional test against zero.
--- 2275,2284 ----
    mask_cst = build_int_cst (int_ptrsize_type, mask);
  
    /* create: and_tmp = or_tmp & mask  */
!   and_tmp_name = make_temp_ssa_name (int_ptrsize_type, NULL, "andmask");
  
    and_stmt = gimple_build_assign_with_ops (BIT_AND_EXPR, and_tmp_name,
  					   or_tmp_name, mask_cst);
    gimple_seq_add_stmt (cond_expr_stmt_list, and_stmt);
  
    /* Make and_tmp the left operand of the conditional test against zero.
Index: gcc/tree-vect-patterns.c
===================================================================
*** gcc/tree-vect-patterns.c.orig	2012-08-02 10:13:52.000000000 +0200
--- gcc/tree-vect-patterns.c	2012-08-09 14:53:45.377749919 +0200
*************** type_conversion_p (tree name, gimple use
*** 206,214 ****
  static tree
  vect_recog_temp_ssa_var (tree type, gimple stmt)
  {
!   tree var = create_tmp_reg (type, "patt");
!   var = make_ssa_name (var, stmt);
!   return var;
  }
  
  /* Function vect_recog_dot_prod_pattern
--- 206,212 ----
  static tree
  vect_recog_temp_ssa_var (tree type, gimple stmt)
  {
!   return make_temp_ssa_name (type, stmt, "patt");
  }
  
  /* Function vect_recog_dot_prod_pattern
*************** vect_handle_widen_op_by_const (gimple st
*** 450,456 ****
     		               VEC (gimple, heap) **stmts, tree type,
  			       tree *half_type, gimple def_stmt)
  {
!   tree new_type, new_oprnd, tmp;
    gimple new_stmt;
  
    if (code != MULT_EXPR && code != LSHIFT_EXPR)
--- 448,454 ----
     		               VEC (gimple, heap) **stmts, tree type,
  			       tree *half_type, gimple def_stmt)
  {
!   tree new_type, new_oprnd;
    gimple new_stmt;
  
    if (code != MULT_EXPR && code != LSHIFT_EXPR)
*************** vect_handle_widen_op_by_const (gimple st
*** 499,506 ****
      {
        /* Create a_T = (NEW_TYPE) a_t;  */
        *oprnd = gimple_assign_rhs1 (def_stmt);
!       tmp = create_tmp_reg (new_type, NULL);
!       new_oprnd = make_ssa_name (tmp, NULL);
        new_stmt = gimple_build_assign_with_ops (NOP_EXPR, new_oprnd, *oprnd,
  					       NULL_TREE);
        STMT_VINFO_RELATED_STMT (vinfo_for_stmt (def_stmt)) = new_stmt;
--- 497,503 ----
      {
        /* Create a_T = (NEW_TYPE) a_t;  */
        *oprnd = gimple_assign_rhs1 (def_stmt);
!       new_oprnd = make_ssa_name (new_type, NULL);
        new_stmt = gimple_build_assign_with_ops (NOP_EXPR, new_oprnd, *oprnd,
  					       NULL_TREE);
        STMT_VINFO_RELATED_STMT (vinfo_for_stmt (def_stmt)) = new_stmt;
*************** vect_operation_fits_smaller_type (gimple
*** 962,968 ****
  {
    enum tree_code code;
    tree const_oprnd, oprnd;
!   tree interm_type = NULL_TREE, half_type, tmp, new_oprnd, type;
    gimple def_stmt, new_stmt;
    bool first = false;
    bool promotion;
--- 959,965 ----
  {
    enum tree_code code;
    tree const_oprnd, oprnd;
!   tree interm_type = NULL_TREE, half_type, new_oprnd, type;
    gimple def_stmt, new_stmt;
    bool first = false;
    bool promotion;
*************** vect_operation_fits_smaller_type (gimple
*** 1103,1110 ****
              {
                /* Create NEW_OPRND = (INTERM_TYPE) OPRND.  */
                oprnd = gimple_assign_rhs1 (def_stmt);
!               tmp = create_tmp_reg (interm_type, NULL);
!               new_oprnd = make_ssa_name (tmp, NULL);
                new_stmt = gimple_build_assign_with_ops (NOP_EXPR, new_oprnd,
                                                         oprnd, NULL_TREE);
                STMT_VINFO_RELATED_STMT (vinfo_for_stmt (def_stmt)) = new_stmt;
--- 1100,1106 ----
              {
                /* Create NEW_OPRND = (INTERM_TYPE) OPRND.  */
                oprnd = gimple_assign_rhs1 (def_stmt);
!               new_oprnd = make_ssa_name (interm_type, NULL);
                new_stmt = gimple_build_assign_with_ops (NOP_EXPR, new_oprnd,
                                                         oprnd, NULL_TREE);
                STMT_VINFO_RELATED_STMT (vinfo_for_stmt (def_stmt)) = new_stmt;
*************** vect_operation_fits_smaller_type (gimple
*** 1123,1130 ****
        if (interm_type)
          {
            /* Create a type conversion HALF_TYPE->INTERM_TYPE.  */
!           tmp = create_tmp_reg (interm_type, NULL);
!           new_oprnd = make_ssa_name (tmp, NULL);
            new_stmt = gimple_build_assign_with_ops (NOP_EXPR, new_oprnd,
                                                     oprnd, NULL_TREE);
            oprnd = new_oprnd;
--- 1119,1125 ----
        if (interm_type)
          {
            /* Create a type conversion HALF_TYPE->INTERM_TYPE.  */
!           new_oprnd = make_ssa_name (interm_type, NULL);
            new_stmt = gimple_build_assign_with_ops (NOP_EXPR, new_oprnd,
                                                     oprnd, NULL_TREE);
            oprnd = new_oprnd;
*************** vect_recog_over_widening_pattern (VEC (g
*** 1171,1177 ****
    gimple stmt = VEC_pop (gimple, *stmts);
    gimple pattern_stmt = NULL, new_def_stmt, prev_stmt = NULL, use_stmt = NULL;
    tree op0, op1, vectype = NULL_TREE, use_lhs, use_type;
!   tree var = NULL_TREE, new_type = NULL_TREE, tmp, new_oprnd;
    bool first;
    tree type = NULL;
  
--- 1166,1172 ----
    gimple stmt = VEC_pop (gimple, *stmts);
    gimple pattern_stmt = NULL, new_def_stmt, prev_stmt = NULL, use_stmt = NULL;
    tree op0, op1, vectype = NULL_TREE, use_lhs, use_type;
!   tree var = NULL_TREE, new_type = NULL_TREE, new_oprnd;
    bool first;
    tree type = NULL;
  
*************** vect_recog_over_widening_pattern (VEC (g
*** 1254,1261 ****
            || TYPE_PRECISION (new_type) != TYPE_PRECISION (use_type))
          {
            /* Create NEW_TYPE->USE_TYPE conversion.  */
!           tmp = create_tmp_reg (use_type, NULL);
!           new_oprnd = make_ssa_name (tmp, NULL);
            pattern_stmt = gimple_build_assign_with_ops (NOP_EXPR, new_oprnd,
                                                         var, NULL_TREE);
            STMT_VINFO_RELATED_STMT (vinfo_for_stmt (use_stmt)) = pattern_stmt;
--- 1249,1255 ----
            || TYPE_PRECISION (new_type) != TYPE_PRECISION (use_type))
          {
            /* Create NEW_TYPE->USE_TYPE conversion.  */
!           new_oprnd = make_ssa_name (use_type, NULL);
            pattern_stmt = gimple_build_assign_with_ops (NOP_EXPR, new_oprnd,
                                                         var, NULL_TREE);
            STMT_VINFO_RELATED_STMT (vinfo_for_stmt (use_stmt)) = pattern_stmt;
Index: gcc/tree-vect-stmts.c
===================================================================
*** gcc/tree-vect-stmts.c.orig	2012-08-07 16:30:56.000000000 +0200
--- gcc/tree-vect-stmts.c	2012-08-09 13:42:42.709897499 +0200
*************** vect_init_vector (gimple stmt, tree val,
*** 1270,1281 ****
  	    val = fold_unary (VIEW_CONVERT_EXPR, TREE_TYPE (type), val);
  	  else
  	    {
! 	      new_var = create_tmp_reg (TREE_TYPE (type), NULL);
  	      init_stmt = gimple_build_assign_with_ops (NOP_EXPR,
! 							new_var, val,
  							NULL_TREE);
- 	      new_temp = make_ssa_name (new_var, init_stmt);
- 	      gimple_assign_set_lhs (init_stmt, new_temp);
  	      vect_init_vector_1 (stmt, init_stmt, gsi);
  	      val = new_temp;
  	    }
--- 1270,1279 ----
  	    val = fold_unary (VIEW_CONVERT_EXPR, TREE_TYPE (type), val);
  	  else
  	    {
! 	      new_temp = make_ssa_name (TREE_TYPE (type), NULL);
  	      init_stmt = gimple_build_assign_with_ops (NOP_EXPR,
! 							new_temp, val,
  							NULL_TREE);
  	      vect_init_vector_1 (stmt, init_stmt, gsi);
  	      val = new_temp;
  	    }
Index: gcc/tree-vrp.c
===================================================================
*** gcc/tree-vrp.c.orig	2012-08-08 16:38:20.000000000 +0200
--- gcc/tree-vrp.c	2012-08-09 13:33:38.465916351 +0200
*************** simplify_truth_ops_using_ranges (gimple_
*** 8042,8054 ****
    /* For A != B we substitute A ^ B.  Either with conversion.  */
    else if (need_conversion)
      {
!       gimple newop;
!       tree tem = create_tmp_reg (TREE_TYPE (op0), NULL);
!       newop = gimple_build_assign_with_ops (BIT_XOR_EXPR, tem, op0, op1);
!       tem = make_ssa_name (tem, newop);
!       gimple_assign_set_lhs (newop, tem);
        gsi_insert_before (gsi, newop, GSI_SAME_STMT);
-       update_stmt (newop);
        gimple_assign_set_rhs_with_ops (gsi, NOP_EXPR, tem, NULL_TREE);
      }
    /* Or without.  */
--- 8042,8050 ----
    /* For A != B we substitute A ^ B.  Either with conversion.  */
    else if (need_conversion)
      {
!       tree tem = make_ssa_name (TREE_TYPE (op0), NULL);
!       gimple newop = gimple_build_assign_with_ops (BIT_XOR_EXPR, tem, op0, op1);
        gsi_insert_before (gsi, newop, GSI_SAME_STMT);
        gimple_assign_set_rhs_with_ops (gsi, NOP_EXPR, tem, NULL_TREE);
      }
    /* Or without.  */
*************** simplify_float_conversion_using_ranges (
*** 8707,8717 ****
  
    /* It works, insert a truncation or sign-change before the
       float conversion.  */
!   tem = create_tmp_var (build_nonstandard_integer_type
  			  (GET_MODE_PRECISION (mode), 0), NULL);
    conv = gimple_build_assign_with_ops (NOP_EXPR, tem, rhs1, NULL_TREE);
-   tem = make_ssa_name (tem, conv);
-   gimple_assign_set_lhs (conv, tem);
    gsi_insert_before (gsi, conv, GSI_SAME_STMT);
    gimple_assign_set_rhs1 (stmt, tem);
    update_stmt (stmt);
--- 8703,8711 ----
  
    /* It works, insert a truncation or sign-change before the
       float conversion.  */
!   tem = make_ssa_name (build_nonstandard_integer_type
  			  (GET_MODE_PRECISION (mode), 0), NULL);
    conv = gimple_build_assign_with_ops (NOP_EXPR, tem, rhs1, NULL_TREE);
    gsi_insert_before (gsi, conv, GSI_SAME_STMT);
    gimple_assign_set_rhs1 (stmt, tem);
    update_stmt (stmt);


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