public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH][2/2] Remove referenced vars
@ 2012-08-01 13:38 Richard Guenther
  2012-08-02  8:13 ` Richard Guenther
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Guenther @ 2012-08-01 13:38 UTC (permalink / raw)
  To: gcc-patches


This is the combined patch, ontop of 2a and 2b this removes all
gimple_referenced_vars and add_referenced_vars calls.

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

GCC is a better place w/o referenced vars ;)

Richard.

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

	* tree-dfa.c (referenced_var_lookup): Remove.
	(find_referenced_vars): Remove.
	(pass_referenced_vars): Likewise.
	(make_rename_temp): Do not add referenced vars.
	(dump_referenced_vars): Remove.
	(debug_referenced_vars): Likewise.
	(dump_dfa_stats): Do not dump referenced var stats.
	(find_vars_r): Remove.
	(find_referenced_vars_in): Likewise.
	(referenced_var_check_and_insert): Likewise.
	(add_referenced_var_1): Likewise.
	(remove_referenced_var): Likewise.
	* tree-flow.h (referenced_var_lookup): Likewise.
	(struct gimple_df): Remove referenced_vars member.
	(typedef referenced_var_iterator): Remove.
	(FOR_EACH_REFERENCED_VAR): Likewise.
	(num_referenced_vars): Likewise.
	(debug_referenced_vars, dump_referenced_vars): Likewise.
	(add_referenced_var_1, add_referenced_var): Likewise.
	(remove_referenced_var): Likewise.
	(find_referenced_vars_in): Likewise.
	* tree-flow-inline.h (gimple_referenced_vars): Remove.
	(first_referenced_var): Likewise.
	(end_referenced_vars_p): Likewise.
	(next_referenced_var): Likewise.
	* cfgexpand.c (update_alias_info_with_stack_vars): Remove assert.
	* gimple-pretty-print.c (pp_points_to_solution): Dump UIDs
	unconditionally.
	* tree-into-ssa.c (dump_decl_set): Likewise.
	(pass_build_ssa): Do not require PROP_referenced_vars.
	* tree-ssa.c (target_for_debug_bind): Virtual operands are
	not suitable, but all register type vars are.
	(init_tree_ssa): Do not allocate referenced vars.
	(delete_tree_ssa): Do not free referenced vars.
	* cgraphunit.c (init_lowered_empty_function): Do not set
	PROP_referenced_vars.
	(assemble_thunk): Do not add referenced vars.
	* gimple-fold.c (canonicalize_constructor_val): Likewise.
	(gimplify_and_update_call_from_tree): Likewise.
	* gimple-streamer-in.c (input_bb): Likewise.
	* passes.c (init_optimization_passes): Do not run
	pass_referenced_vars.
	(dump_properties): Do not dump PROP_referenced_vars.
	* tree-inline.c (remap_decl): Do not add referenced vars.
	(remap_gimple_op_r): Likewise.
	(copy_tree_body_r): Likewise.
	(copy_bb): Likewise.
	(setup_one_parameter): Likewise.
	(declare_return_variable): Likewise.
	(copy_decl_for_dup_finish): Likewise.
	(copy_arguments_for_versioning): Likewise.
	(tree_function_versioning): Likewise.
	* tree-pass.h (PROP_referenced_vars): Remove.
	(pass_referenced_vars): Likewise.
	* tree-profile.c (gimple_gen_edge_profiler): Do not add referenced vars.
	(gimple_gen_interval_profiler): Likewise.
	(gimple_gen_pow2_profiler): Likewise.
	(gimple_gen_one_value_profiler): Likewise.
	(gimple_gen_ic_profiler): Likewise.
	(gimple_gen_average_profiler): Likewise.
	(gimple_gen_ior_profiler): Likewise.
	* tree-ssa-live.c (remove_unused_locals): Do not touch referenced vars.
	* tree-cfg.c (replace_ssa_name): Do not add referenced vars.
	(move_stmt_op): Likewise.
	* tree-ssa-operands.c (create_vop_var): Likewise.
	* gimple-low.c (record_vars_into): Likewise.
	* gimplify.c (gimple_regimplify_operands): Likewise.
	(force_gimple_operand_1): Likewise.
	* omp-low.c (expand_omp_for_generic): Likewise.
	(expand_omp_for_static_chunk): Likewise.
	(expand_omp_atomic_pipeline): Likewise.
	* graphite-clast-to-gimple.c (graphite_create_new_loop): Likewise.
	(translate_clast_assignment): Likewise.
	* graphite-sese-to-poly.c (create_zero_dim_array): Likewise.
	(handle_scalar_deps_crossing_scop_limits): Likewise.
	* ipa-prop.c (ipa_modify_formal_parameters): Likewise.
	* ipa-split.c (split_function): Likewise.
	* matrix-reorg.c (transform_access_sites): Likewise.
	* trans-mem.c (tm_log_add): Likewise.
	(ipa_tm_insert_gettmclone_call): Likewise.
	* tree-complex.c (create_one_component_var): Likewise.
	* tree-if-conv.c (ifc_temp_var): Likewise.
	* tree-parloops.c (take_address_of): Likewise.
	(initialize_reductions): Likewise.
	(separate_decls_in_region_name): Likewise.
	(create_call_for_reduction_1): Likewise.
	(separate_decls_in_region): Likewise.
	* tree-predcom.c (predcom_tmp_var): Likewise.
	(reassociate_to_the_same_stmt): Likewise.
	* tree-sra.c (build_ref_for_offset): Likewise.
	(create_access_replacement): Likewise.
	(get_replaced_param_substitute): Likewise.
	(sra_ipa_reset_debug_stmts): Likewise.
	* tree-ssa-loop-im.c (rewrite_reciprocal): Likewise.
	(rewrite_bittest): Likewise.
	* tree-ssa-loop-ivopts.c (create_new_iv): Likewise.
	* tree-ssa-loop-manip.c (create_iv): Likewise.
	(tree_transform_and_unroll_loop): Likewise.
	* tree-ssa-math-opts.c (powi_as_mults): Likewise.
	(build_and_insert_call): Likewise.
	(gimple_expand_builtin_cabs): Likewise.
	(execute_optimize_bswap): Likewise.
	* tree-ssa-phiopt.c (conditional_replacement): Likewise.
	(abs_replacement): Likewise.
	(cond_store_replacement): Likewise.
	(cond_if_else_store_replacement_1): Likewise.
	* tree-ssa-phiprop.c (phiprop_insert_phi): Likewise.
	* tree-ssa-pre.c (get_representative_for): Likewise.
	(create_expression_by_pieces): Likewise.
	(insert_into_preds_of_block): Likewise.
	* tree-ssa-propagate.c (update_call_from_tree): Likewise.
	* tree-ssa-reassoc.c (undistribute_ops_list): Likewise.
	(eliminate_redundant_comparison): Likewise.
	(rewrite_expr_tree_parallel): Likewise.
	(get_reassoc_pow_ssa_name): Likewise.
	* tree-ssa-strlen.c (get_string_length): Likewise.
	* 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-data-refs.c (vect_get_new_vect_var): Likewise.
	(vect_create_addr_base_for_vector_ref): Likewise.
	(vect_permute_store_chain): Likewise.
	(vect_permute_load_chain): Likewise.
	* tree-vect-generic.c (expand_vector_divmod): Likewise.
	* tree-vect-loop-manip.c (set_prologue_iterations): Likewise.
	(vect_build_loop_niters): Likewise.
	(vect_generate_tmps_on_preheader): Likewise.
	(vect_update_ivs_after_vectorizer): Likewise.
	(vect_gen_niters_for_prolog_loop): Likewise.
	(vect_do_peeling_for_alignment): Likewise.
	(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.

Index: trunk/gcc/cfgexpand.c
===================================================================
*** trunk.orig/gcc/cfgexpand.c	2012-08-01 15:13:52.000000000 +0200
--- trunk/gcc/cfgexpand.c	2012-08-01 15:15:40.762635978 +0200
*************** update_alias_info_with_stack_vars (void)
*** 620,632 ****
  	{
  	  tree decl = stack_vars[j].decl;
  	  unsigned int uid = DECL_PT_UID (decl);
- 	  /* We should never end up partitioning SSA names (though they
- 	     may end up on the stack).  Neither should we allocate stack
- 	     space to something that is unused and thus unreferenced, except
- 	     for -O0 where we are preserving even unreferenced variables.  */
- 	  gcc_assert (DECL_P (decl)
- 		      && (!optimize
- 			  || referenced_var_lookup (cfun, DECL_UID (decl))));
  	  bitmap_set_bit (part, uid);
  	  *((bitmap *) pointer_map_insert (decls_to_partitions,
  					   (void *)(size_t) uid)) = part;
--- 620,625 ----
Index: trunk/gcc/gimple-pretty-print.c
===================================================================
*** trunk.orig/gcc/gimple-pretty-print.c	2012-08-01 15:13:52.000000000 +0200
--- trunk/gcc/gimple-pretty-print.c	2012-08-01 15:15:40.763635978 +0200
*************** pp_points_to_solution (pretty_printer *b
*** 597,617 ****
        pp_string (buffer, "{ ");
        EXECUTE_IF_SET_IN_BITMAP (pt->vars, 0, i, bi)
  	{
! 	  tree var = referenced_var_lookup (cfun, i);
! 	  if (var)
! 	    {
! 	      dump_generic_node (buffer, var, 0, dump_flags, false);
! 	      if (DECL_PT_UID (var) != DECL_UID (var))
! 		{
! 		  pp_string (buffer, "ptD.");
! 		  pp_decimal_int (buffer, DECL_PT_UID (var));
! 		}
! 	    }
! 	  else
! 	    {
! 	      pp_string (buffer, "D.");
! 	      pp_decimal_int (buffer, i);
! 	    }
  	  pp_character (buffer, ' ');
  	}
        pp_character (buffer, '}');
--- 597,604 ----
        pp_string (buffer, "{ ");
        EXECUTE_IF_SET_IN_BITMAP (pt->vars, 0, i, bi)
  	{
! 	  pp_string (buffer, "D.");
! 	  pp_decimal_int (buffer, i);
  	  pp_character (buffer, ' ');
  	}
        pp_character (buffer, '}');
Index: trunk/gcc/tree-dfa.c
===================================================================
*** trunk.orig/gcc/tree-dfa.c	2012-08-01 15:13:52.000000000 +0200
--- trunk/gcc/tree-dfa.c	2012-08-01 15:15:40.770635978 +0200
*************** static void collect_dfa_stats (struct df
*** 63,118 ****
  /*---------------------------------------------------------------------------
  			Dataflow analysis (DFA) routines
  ---------------------------------------------------------------------------*/
- /* Find all the variables referenced in the function.  This function
-    builds the global arrays REFERENCED_VARS and CALL_CLOBBERED_VARS.
- 
-    Note that this function does not look for statement operands, it simply
-    determines what variables are referenced in the program and detects
-    various attributes for each variable used by alias analysis and the
-    optimizer.  */
- 
- static unsigned int
- find_referenced_vars (void)
- {
-   basic_block bb;
-   gimple_stmt_iterator si;
- 
-   FOR_EACH_BB (bb)
-     {
-       for (si = gsi_start_bb (bb); !gsi_end_p (si); gsi_next (&si))
- 	{
- 	  gimple stmt = gsi_stmt (si);
- 	  if (is_gimple_debug (stmt))
- 	    continue;
- 	  find_referenced_vars_in (gsi_stmt (si));
- 	}
- 
-       for (si = gsi_start_phis (bb); !gsi_end_p (si); gsi_next (&si))
- 	find_referenced_vars_in (gsi_stmt (si));
-     }
- 
-   return 0;
- }
- 
- struct gimple_opt_pass pass_referenced_vars =
- {
-  {
-   GIMPLE_PASS,
-   "*referenced_vars",			/* name */
-   NULL,					/* gate */
-   find_referenced_vars,			/* execute */
-   NULL,					/* sub */
-   NULL,					/* next */
-   0,					/* static_pass_number */
-   TV_FIND_REFERENCED_VARS,		/* tv_id */
-   PROP_gimple_leh | PROP_cfg,		/* properties_required */
-   PROP_referenced_vars,			/* properties_provided */
-   0,					/* properties_destroyed */
-   0,                     		/* todo_flags_start */
-   0                                     /* todo_flags_finish */
-  }
- };
- 
  
  /* Renumber all of the gimple stmt uids.  */
  
--- 63,68 ----
*************** renumber_gimple_stmt_uids_in_blocks (bas
*** 169,180 ****
  tree
  make_rename_temp (tree type, const char *prefix)
  {
!   tree t = create_tmp_reg (type, prefix);
! 
!   if (gimple_referenced_vars (cfun))
!     add_referenced_var (t);
! 
!   return t;
  }
  
  
--- 119,125 ----
  tree
  make_rename_temp (tree type, const char *prefix)
  {
!   return create_tmp_reg (type, prefix);
  }
  
  
*************** make_rename_temp (tree type, const char
*** 182,217 ****
  /*---------------------------------------------------------------------------
  			      Debugging functions
  ---------------------------------------------------------------------------*/
- /* Dump the list of all the referenced variables in the current function to
-    FILE.  */
- 
- void
- dump_referenced_vars (FILE *file)
- {
-   tree var;
-   referenced_var_iterator rvi;
- 
-   fprintf (file, "\nReferenced variables in %s: %u\n\n",
- 	   get_name (current_function_decl), (unsigned) num_referenced_vars);
- 
-   FOR_EACH_REFERENCED_VAR (cfun, var, rvi)
-     {
-       fprintf (file, "Variable: ");
-       dump_variable (file, var);
-     }
- 
-   fprintf (file, "\n");
- }
- 
- 
- /* Dump the list of all the referenced variables to stderr.  */
- 
- DEBUG_FUNCTION void
- debug_referenced_vars (void)
- {
-   dump_referenced_vars (stderr);
- }
- 
  
  /* Dump variable VAR and its may-aliases to FILE.  */
  
--- 127,132 ----
*************** dump_dfa_stats (FILE *file)
*** 297,307 ****
    fprintf (file, fmt_str, "", "  instances  ", "used ");
    fprintf (file, "---------------------------------------------------------\n");
  
-   size = num_referenced_vars * sizeof (tree);
-   total += size;
-   fprintf (file, fmt_str_1, "Referenced variables", (unsigned long)num_referenced_vars,
- 	   SCALE (size), LABEL (size));
- 
    size = dfa_stats.num_uses * sizeof (tree *);
    total += size;
    fprintf (file, fmt_str_1, "USE operands", dfa_stats.num_uses,
--- 212,217 ----
*************** collect_dfa_stats (struct dfa_stats_d *d
*** 397,493 ****
  /*---------------------------------------------------------------------------
  			     Miscellaneous helpers
  ---------------------------------------------------------------------------*/
- /* Callback for walk_tree.  Used to collect variables referenced in
-    the function.  */
- 
- static tree
- find_vars_r (tree *tp, int *walk_subtrees, void *data)
- {
-   struct function *fn = (struct function *) data;
- 
-   /* If we are reading the lto info back in, we need to rescan the
-      referenced vars.  */
-   if (TREE_CODE (*tp) == SSA_NAME)
-     add_referenced_var_1 (SSA_NAME_VAR (*tp), fn);
- 
-   /* If T is a regular variable that the optimizers are interested
-      in, add it to the list of variables.  */
-   else if ((TREE_CODE (*tp) == VAR_DECL
- 	    && !is_global_var (*tp))
- 	   || TREE_CODE (*tp) == PARM_DECL
- 	   || TREE_CODE (*tp) == RESULT_DECL)
-     add_referenced_var_1 (*tp, fn);
- 
-   /* Type, _DECL and constant nodes have no interesting children.
-      Ignore them.  */
-   else if (IS_TYPE_OR_DECL_P (*tp) || CONSTANT_CLASS_P (*tp))
-     *walk_subtrees = 0;
- 
-   return NULL_TREE;
- }
- 
- /* Find referenced variables in STMT.  */
- 
- void
- find_referenced_vars_in (gimple stmt)
- {
-   size_t i;
- 
-   if (gimple_code (stmt) != GIMPLE_PHI)
-     {
-       for (i = 0; i < gimple_num_ops (stmt); i++)
- 	walk_tree (gimple_op_ptr (stmt, i), find_vars_r, cfun, NULL);
-     }
-   else
-     {
-       walk_tree (gimple_phi_result_ptr (stmt), find_vars_r, cfun, NULL);
- 
-       for (i = 0; i < gimple_phi_num_args (stmt); i++)
- 	{
- 	  tree arg = gimple_phi_arg_def (stmt, i);
- 	  walk_tree (&arg, find_vars_r, cfun, NULL);
- 	}
-     }
- }
- 
- 
- /* Lookup UID in the referenced_vars hashtable and return the associated
-    variable.  */
- 
- tree
- referenced_var_lookup (struct function *fn, unsigned int uid)
- {
-   tree h;
-   struct tree_decl_minimal in;
-   in.uid = uid;
-   h = (tree) htab_find_with_hash (gimple_referenced_vars (fn), &in, uid);
-   return h;
- }
- 
- /* Check if TO is in the referenced_vars hash table and insert it if not.
-    Return true if it required insertion.  */
- 
- static bool
- referenced_var_check_and_insert (tree to, struct function *fn)
- {
-   tree *loc;
-   struct tree_decl_minimal in;
-   unsigned int uid = DECL_UID (to);
- 
-   in.uid = uid;
-   loc = (tree *) htab_find_slot_with_hash (gimple_referenced_vars (fn),
- 					   &in, uid, INSERT);
-   if (*loc)
-     {
-       /* DECL_UID has already been entered in the table.  Verify that it is
- 	 the same entry as TO.  See PR 27793.  */
-       gcc_assert (*loc == to);
-       return false;
-     }
- 
-   *loc = to;
-   return true;
- }
  
  /* Lookup VAR UID in the default_defs hashtable and return the associated
     variable.  */
--- 307,312 ----
*************** set_default_def (tree var, tree def)
*** 536,585 ****
     SSA_NAME_IS_DEFAULT_DEF (def) = true;
  }
  
- /* Add VAR to the list of referenced variables if it isn't already there.  */
- 
- bool
- add_referenced_var_1 (tree var, struct function *fn)
- {
-   gcc_checking_assert (TREE_CODE (var) == VAR_DECL
- 		       || TREE_CODE (var) == PARM_DECL
- 		       || TREE_CODE (var) == RESULT_DECL);
- 
-   gcc_checking_assert ((TREE_CODE (var) == VAR_DECL
- 			&& VAR_DECL_IS_VIRTUAL_OPERAND (var))
- 		       || !is_global_var (var));
- 
-   /* Insert VAR into the referenced_vars hash table if it isn't present
-      and allocate its var-annotation.  */
-   if (referenced_var_check_and_insert (var, fn))
-     return true;
- 
-   return false;
- }
- 
- /* Remove VAR from the list of referenced variables and clear its
-    var-annotation.  */
- 
- void
- remove_referenced_var (tree var)
- {
-   struct tree_decl_minimal in;
-   void **loc;
-   unsigned int uid = DECL_UID (var);
- 
-   gcc_checking_assert (TREE_CODE (var) == VAR_DECL
- 		       || TREE_CODE (var) == PARM_DECL
- 		       || TREE_CODE (var) == RESULT_DECL);
- 
-   gcc_checking_assert (!is_global_var (var));
- 
-   in.uid = uid;
-   loc = htab_find_slot_with_hash (gimple_referenced_vars (cfun), &in, uid,
- 				  NO_INSERT);
-   if (loc)
-     htab_clear_slot (gimple_referenced_vars (cfun), loc);
- }
- 
  
  /* If EXP is a handled component reference for a structure, return the
     base variable.  The access range is delimited by bit positions *POFFSET and
--- 355,360 ----
Index: trunk/gcc/tree-flow.h
===================================================================
*** trunk.orig/gcc/tree-flow.h	2012-08-01 15:13:52.000000000 +0200
--- trunk/gcc/tree-flow.h	2012-08-01 15:15:40.784635977 +0200
*************** struct GTY(()) tm_restart_node {
*** 45,53 ****
     gimple_ accessor defined in tree-flow-inline.h, all publicly modifiable
     fields should have gimple_set accessor.  */
  struct GTY(()) gimple_df {
-   /* Array of all variables referenced in the function.  */
-   htab_t GTY((param_is (union tree_node))) referenced_vars;
- 
    /* A vector of all the noreturn calls passed to modify_stmt.
       cleanup_control_flow uses it to detect cases where a mid-block
       indirect call has been turned into a noreturn call.  When this
--- 45,50 ----
*************** extern int int_tree_map_eq (const void *
*** 292,315 ****
  extern unsigned int uid_decl_map_hash (const void *);
  extern int uid_decl_map_eq (const void *, const void *);
  
- typedef struct
- {
-   htab_iterator hti;
- } referenced_var_iterator;
- 
- /* This macro loops over all the referenced vars, one at a time, putting the
-    current var in VAR.  Note:  You are not allowed to add referenced variables
-    to the hashtable while using this macro.  Doing so may cause it to behave
-    erratically.  */
- 
- #define FOR_EACH_REFERENCED_VAR(FN, VAR, ITER)		\
-   for ((VAR) = first_referenced_var ((FN), &(ITER));	\
-        !end_referenced_vars_p (&(ITER));		\
-        (VAR) = next_referenced_var (&(ITER)))
- 
- extern tree referenced_var_lookup (struct function *, unsigned int);
- #define num_referenced_vars htab_elements (gimple_referenced_vars (cfun))
- 
  #define num_ssa_names (VEC_length (tree, cfun->gimple_df->ssa_names))
  #define ssa_name(i) (VEC_index (tree, cfun->gimple_df->ssa_names, (i)))
  
--- 289,294 ----
*************** extern void renumber_gimple_stmt_uids (v
*** 463,481 ****
  extern void renumber_gimple_stmt_uids_in_blocks (basic_block *, int);
  extern void dump_dfa_stats (FILE *);
  extern void debug_dfa_stats (void);
- extern void debug_referenced_vars (void);
- extern void dump_referenced_vars (FILE *);
  extern void dump_variable (FILE *, tree);
  extern void debug_variable (tree);
- extern bool add_referenced_var_1 (tree, struct function *);
- #define add_referenced_var(v) add_referenced_var_1 ((v), cfun)
- extern void remove_referenced_var (tree);
  extern tree make_rename_temp (tree, const char *);
  extern void set_default_def (tree, tree);
  extern tree gimple_default_def (struct function *, tree);
  extern bool stmt_references_abnormal_ssa_name (gimple);
  extern tree get_addr_base_and_unit_offset (tree, HOST_WIDE_INT *);
- extern void find_referenced_vars_in (gimple);
  extern void dump_enumerated_decls (FILE *, int);
  
  /* In tree-phinodes.c  */
--- 442,454 ----
Index: trunk/gcc/tree-into-ssa.c
===================================================================
*** trunk.orig/gcc/tree-into-ssa.c	2012-08-01 15:13:52.000000000 +0200
--- trunk/gcc/tree-into-ssa.c	2012-08-01 15:15:40.773635978 +0200
*************** dump_decl_set (FILE *file, bitmap set)
*** 1551,1561 ****
  
        EXECUTE_IF_SET_IN_BITMAP (set, 0, i, bi)
  	{
! 	  tree var = referenced_var_lookup (cfun, i);
! 	  if (var)
! 	    print_generic_expr (file, var, 0);
! 	  else
! 	    fprintf (file, "D.%u", i);
  	  fprintf (file, " ");
  	}
  
--- 1551,1557 ----
  
        EXECUTE_IF_SET_IN_BITMAP (set, 0, i, bi)
  	{
! 	  fprintf (file, "D.%u", i);
  	  fprintf (file, " ");
  	}
  
*************** struct gimple_opt_pass pass_build_ssa =
*** 2467,2473 ****
    NULL,					/* next */
    0,					/* static_pass_number */
    TV_TREE_SSA_OTHER,			/* tv_id */
!   PROP_cfg | PROP_referenced_vars,	/* properties_required */
    PROP_ssa,				/* properties_provided */
    0,					/* properties_destroyed */
    0,					/* todo_flags_start */
--- 2463,2469 ----
    NULL,					/* next */
    0,					/* static_pass_number */
    TV_TREE_SSA_OTHER,			/* tv_id */
!   PROP_cfg,				/* properties_required */
    PROP_ssa,				/* properties_provided */
    0,					/* properties_destroyed */
    0,					/* todo_flags_start */
Index: trunk/gcc/tree-ssa.c
===================================================================
*** trunk.orig/gcc/tree-ssa.c	2012-08-01 15:13:52.000000000 +0200
--- trunk/gcc/tree-ssa.c	2012-08-01 15:15:40.776635977 +0200
*************** target_for_debug_bind (tree var)
*** 249,255 ****
    if (!MAY_HAVE_DEBUG_STMTS)
      return NULL_TREE;
  
!   if (TREE_CODE (var) != VAR_DECL
        && TREE_CODE (var) != PARM_DECL)
      return NULL_TREE;
  
--- 249,256 ----
    if (!MAY_HAVE_DEBUG_STMTS)
      return NULL_TREE;
  
!   if ((TREE_CODE (var) != VAR_DECL
!        || VAR_DECL_IS_VIRTUAL_OPERAND (var))
        && TREE_CODE (var) != PARM_DECL)
      return NULL_TREE;
  
*************** target_for_debug_bind (tree var)
*** 259,271 ****
    if (DECL_IGNORED_P (var))
      return NULL_TREE;
  
!   if (!is_gimple_reg (var))
!     {
!       if (is_gimple_reg_type (TREE_TYPE (var))
! 	  && referenced_var_lookup (cfun, DECL_UID (var)) == NULL_TREE)
! 	return var;
!       return NULL_TREE;
!     }
  
    return var;
  }
--- 260,268 ----
    if (DECL_IGNORED_P (var))
      return NULL_TREE;
  
!   /* var-tracking only tracks registers.  */
!   if (!is_gimple_reg_type (TREE_TYPE (var)))
!     return NULL_TREE;
  
    return var;
  }
*************** void
*** 1107,1114 ****
  init_tree_ssa (struct function *fn)
  {
    fn->gimple_df = ggc_alloc_cleared_gimple_df ();
-   fn->gimple_df->referenced_vars = htab_create_ggc (20, uid_decl_map_hash,
- 				     		    uid_decl_map_eq, NULL);
    fn->gimple_df->default_defs = htab_create_ggc (20, uid_ssaname_map_hash,
  				                 uid_ssaname_map_eq, NULL);
    pt_solution_reset (&fn->gimple_df->escaped);
--- 1104,1109 ----
*************** struct gimple_opt_pass pass_init_datastr
*** 1150,1159 ****
  void
  delete_tree_ssa (void)
  {
-   /* Remove annotations from every referenced local variable.  */
-   htab_delete (gimple_referenced_vars (cfun));
-   cfun->gimple_df->referenced_vars = NULL;
- 
    fini_ssanames ();
  
    /* We no longer maintain the SSA operand cache at this point.  */
--- 1145,1150 ----
Index: trunk/gcc/cgraphunit.c
===================================================================
*** trunk.orig/gcc/cgraphunit.c	2012-08-01 15:13:49.000000000 +0200
--- trunk/gcc/cgraphunit.c	2012-08-01 15:15:40.785635977 +0200
*************** init_lowered_empty_function (tree decl)
*** 1228,1235 ****
  
    DECL_SAVED_TREE (decl) = error_mark_node;
    cfun->curr_properties |=
!     (PROP_gimple_lcf | PROP_gimple_leh | PROP_cfg | PROP_referenced_vars |
!      PROP_ssa | PROP_gimple_any);
  
    /* Create BB for body of the function and connect it properly.  */
    bb = create_basic_block (NULL, (void *) 0, ENTRY_BLOCK_PTR);
--- 1228,1234 ----
  
    DECL_SAVED_TREE (decl) = error_mark_node;
    cfun->curr_properties |=
!     (PROP_gimple_lcf | PROP_gimple_leh | PROP_cfg | PROP_ssa | PROP_gimple_any);
  
    /* Create BB for body of the function and connect it properly.  */
    bb = create_basic_block (NULL, (void *) 0, ENTRY_BLOCK_PTR);
*************** assemble_thunk (struct cgraph_node *node
*** 1454,1465 ****
  				      virtual_offset));
        else
          VEC_quick_push (tree, vargs, a);
-       add_referenced_var (a);
        for (i = 1, arg = DECL_CHAIN (a); i < nargs; i++, arg = DECL_CHAIN (arg))
! 	{
! 	  add_referenced_var (arg);
! 	  VEC_quick_push (tree, vargs, arg);
! 	}
        call = gimple_build_call_vec (build_fold_addr_expr_loc (0, alias), vargs);
        VEC_free (tree, heap, vargs);
        gimple_call_set_from_thunk (call, true);
--- 1453,1460 ----
  				      virtual_offset));
        else
          VEC_quick_push (tree, vargs, a);
        for (i = 1, arg = DECL_CHAIN (a); i < nargs; i++, arg = DECL_CHAIN (arg))
! 	VEC_quick_push (tree, vargs, arg);
        call = gimple_build_call_vec (build_fold_addr_expr_loc (0, alias), vargs);
        VEC_free (tree, heap, vargs);
        gimple_call_set_from_thunk (call, true);
Index: trunk/gcc/gimple-fold.c
===================================================================
*** trunk.orig/gcc/gimple-fold.c	2012-08-01 15:13:49.000000000 +0200
--- trunk/gcc/gimple-fold.c	2012-08-01 15:15:40.780635977 +0200
*************** canonicalize_constructor_val (tree cval,
*** 169,180 ****
  	  && !can_refer_decl_in_current_unit_p (base, from_decl))
  	return NULL_TREE;
        if (TREE_CODE (base) == VAR_DECL)
! 	{
! 	  TREE_ADDRESSABLE (base) = 1;
! 	  if (cfun && gimple_referenced_vars (cfun)
! 	      && !is_global_var (base))
! 	    add_referenced_var (base);
! 	}
        else if (TREE_CODE (base) == FUNCTION_DECL)
  	{
  	  /* Make sure we create a cgraph node for functions we'll reference.
--- 169,175 ----
  	  && !can_refer_decl_in_current_unit_p (base, from_decl))
  	return NULL_TREE;
        if (TREE_CODE (base) == VAR_DECL)
! 	TREE_ADDRESSABLE (base) = 1;
        else if (TREE_CODE (base) == FUNCTION_DECL)
  	{
  	  /* Make sure we create a cgraph node for functions we'll reference.
*************** gimplify_and_update_call_from_tree (gimp
*** 653,661 ****
    for (i = gsi_start (stmts); !gsi_end_p (i); gsi_next (&i))
      {
        new_stmt = gsi_stmt (i);
-       /* The replacement can expose previously unreferenced variables.  */
-       if (gimple_in_ssa_p (cfun))
- 	find_referenced_vars_in (new_stmt);
        /* If the new statement possibly has a VUSE, update it with exact SSA
  	 name we know will reach this one.  */
        if (gimple_has_mem_ops (new_stmt))
--- 648,653 ----
Index: trunk/gcc/gimple-streamer-in.c
===================================================================
*** trunk.orig/gcc/gimple-streamer-in.c	2012-08-01 15:13:49.000000000 +0200
--- trunk/gcc/gimple-streamer-in.c	2012-08-01 15:15:40.769635978 +0200
*************** input_bb (struct lto_input_block *ib, en
*** 310,317 ****
    while (tag)
      {
        gimple stmt = input_gimple_stmt (ib, data_in, fn, tag);
-       if (!is_gimple_debug (stmt))
- 	find_referenced_vars_in (stmt);
        gsi_insert_after (&bsi, stmt, GSI_NEW_STMT);
  
        /* After the statement, expect a 0 delimiter or the EH region
--- 310,315 ----
*************** input_bb (struct lto_input_block *ib, en
*** 332,339 ****
    tag = streamer_read_record_start (ib);
    while (tag)
      {
!       gimple phi = input_phi (ib, bb, data_in, fn);
!       find_referenced_vars_in (phi);
        tag = streamer_read_record_start (ib);
      }
  }
--- 330,336 ----
    tag = streamer_read_record_start (ib);
    while (tag)
      {
!       input_phi (ib, bb, data_in, fn);
        tag = streamer_read_record_start (ib);
      }
  }
Index: trunk/gcc/passes.c
===================================================================
*** trunk.orig/gcc/passes.c	2012-08-01 15:13:49.000000000 +0200
--- trunk/gcc/passes.c	2012-08-01 15:15:40.769635978 +0200
*************** init_optimization_passes (void)
*** 1285,1291 ****
        NEXT_PASS (pass_init_datastructures);
        NEXT_PASS (pass_expand_omp);
  
-       NEXT_PASS (pass_referenced_vars);
        NEXT_PASS (pass_build_ssa);
        NEXT_PASS (pass_lower_vector);
        NEXT_PASS (pass_early_warn_uninitialized);
--- 1285,1290 ----
*************** dump_properties (FILE *dump, unsigned in
*** 2603,2610 ****
      fprintf (dump, "PROP_gimple_leh\n");
    if (props & PROP_cfg)
      fprintf (dump, "PROP_cfg\n");
-   if (props & PROP_referenced_vars)
-     fprintf (dump, "PROP_referenced_vars\n");
    if (props & PROP_ssa)
      fprintf (dump, "PROP_ssa\n");
    if (props & PROP_no_crit_edges)
--- 2602,2607 ----
Index: trunk/gcc/tree-flow-inline.h
===================================================================
*** trunk.orig/gcc/tree-flow-inline.h	2012-08-01 15:13:49.000000000 +0200
--- trunk/gcc/tree-flow-inline.h	2012-08-01 15:15:40.784635977 +0200
*************** gimple_in_ssa_p (const struct function *
*** 35,49 ****
    return fun && fun->gimple_df && fun->gimple_df->in_ssa_p;
  }
  
- /* Array of all variables referenced in the function.  */
- static inline htab_t
- gimple_referenced_vars (const struct function *fun)
- {
-   if (!fun || !fun->gimple_df)
-     return NULL;
-   return fun->gimple_df->referenced_vars;
- }
- 
  /* Artificial variable used for the virtual operand FUD chain.  */
  static inline tree
  gimple_vop (const struct function *fun)
--- 35,40 ----
*************** next_htab_element (htab_iterator *hti)
*** 98,131 ****
    return NULL;
  }
  
- /* Initialize ITER to point to the first referenced variable in the
-    referenced_vars hashtable, and return that variable.  */
- 
- static inline tree
- first_referenced_var (struct function *fn, referenced_var_iterator *iter)
- {
-   return (tree) first_htab_element (&iter->hti,
- 				    gimple_referenced_vars (fn));
- }
- 
- /* Return true if we have hit the end of the referenced variables ITER is
-    iterating through.  */
- 
- static inline bool
- end_referenced_vars_p (const referenced_var_iterator *iter)
- {
-   return end_htab_p (&iter->hti);
- }
- 
- /* Make ITER point to the next referenced_var in the referenced_var hashtable,
-    and return that variable.  */
- 
- static inline tree
- next_referenced_var (referenced_var_iterator *iter)
- {
-   return (tree) next_htab_element (&iter->hti);
- }
- 
  /* Get the number of the next statement uid to be allocated.  */
  static inline unsigned int
  gimple_stmt_max_uid (struct function *fn)
--- 89,94 ----
Index: trunk/gcc/tree-inline.c
===================================================================
*** trunk.orig/gcc/tree-inline.c	2012-08-01 15:13:52.000000000 +0200
--- trunk/gcc/tree-inline.c	2012-08-01 15:15:40.785635977 +0200
*************** remap_decl (tree decl, copy_body_data *i
*** 338,354 ****
  	    walk_tree (&DECL_QUALIFIER (t), copy_tree_body_r, id, NULL);
  	}
  
-       if ((TREE_CODE (t) == VAR_DECL
- 	   || TREE_CODE (t) == RESULT_DECL
- 	   || TREE_CODE (t) == PARM_DECL)
- 	  && id->src_fn && DECL_STRUCT_FUNCTION (id->src_fn)
- 	  && gimple_referenced_vars (DECL_STRUCT_FUNCTION (id->src_fn))
- 	  /* We don't want to mark as referenced VAR_DECLs that were
- 	     not marked as such in the src function.  */
- 	  && (TREE_CODE (decl) != VAR_DECL
- 	      || referenced_var_lookup (DECL_STRUCT_FUNCTION (id->src_fn),
- 					DECL_UID (decl))))
- 	add_referenced_var (t);
        return t;
      }
  
--- 338,343 ----
*************** remap_gimple_op_r (tree *tp, int *walk_s
*** 844,857 ****
        if (TREE_CODE (*tp) != OMP_CLAUSE)
  	TREE_TYPE (*tp) = remap_type (TREE_TYPE (*tp), id);
  
-       /* Global variables we haven't seen yet need to go into referenced
- 	 vars.  If not referenced from types only.  */
-       if (gimple_referenced_vars (cfun)
- 	  && TREE_CODE (*tp) == VAR_DECL && !is_global_var (*tp)
- 	  && id->remapping_type_depth == 0
- 	  && !processing_debug_stmt)
- 	add_referenced_var (*tp);
- 
        if (TREE_CODE (*tp) == TARGET_EXPR && TREE_OPERAND (*tp, 3))
  	{
  	  /* The copied TARGET_EXPR has never been expanded, even if the
--- 833,838 ----
*************** copy_tree_body_r (tree *tp, int *walk_su
*** 1087,1100 ****
  	 tweak some special cases.  */
        copy_tree_r (tp, walk_subtrees, NULL);
  
-       /* Global variables we haven't seen yet needs to go into referenced
- 	 vars.  If not referenced from types or debug stmts only.  */
-       if (gimple_referenced_vars (cfun)
- 	  && TREE_CODE (*tp) == VAR_DECL && !is_global_var (*tp)
- 	  && id->remapping_type_depth == 0
- 	  && !processing_debug_stmt)
- 	add_referenced_var (*tp);
- 
        /* If EXPR has block defined, map it to newly constructed block.
           When inlining we want EXPRs without block appear in the block
  	 of function call if we are not remapping a type.  */
--- 1068,1073 ----
*************** copy_bb (copy_body_data *id, basic_block
*** 1764,1770 ****
  	      ssa_op_iter i;
  	      tree def;
  
- 	      find_referenced_vars_in (gsi_stmt (copy_gsi));
  	      FOR_EACH_SSA_TREE_OPERAND (def, stmt, i, SSA_OP_DEF)
  		if (TREE_CODE (def) == SSA_NAME)
  		  SSA_NAME_DEF_STMT (def) = stmt;
--- 1737,1742 ----
*************** setup_one_parameter (copy_body_data *id,
*** 2556,2565 ****
       function.  */
    var = copy_decl_to_var (p, id);
  
-   /* We're actually using the newly-created var.  */
-   if (gimple_in_ssa_p (cfun) && TREE_CODE (var) == VAR_DECL)
-     add_referenced_var (var);
- 
    /* Declare this new variable.  */
    DECL_CHAIN (var) = *vars;
    *vars = var;
--- 2528,2533 ----
*************** setup_one_parameter (copy_body_data *id,
*** 2567,2583 ****
    /* Make gimplifier happy about this variable.  */
    DECL_SEEN_IN_BIND_EXPR_P (var) = 1;
  
-   /* We are eventually using the value - make sure all variables
-      referenced therein are properly recorded.  */
-   if (value
-       && gimple_referenced_vars (cfun)
-       && TREE_CODE (value) == ADDR_EXPR)
-     {
-       tree base = get_base_address (TREE_OPERAND (value, 0));
-       if (base && TREE_CODE (base) == VAR_DECL && !is_global_var (base))
- 	add_referenced_var (base);
-     }
- 
    /* If the parameter is never assigned to, has no SSA_NAMEs created,
       we would not need to create a new variable here at all, if it
       weren't for debug info.  Still, we can just use the argument
--- 2535,2540 ----
*************** declare_return_variable (copy_body_data
*** 2883,2891 ****
    gcc_assert (TREE_CODE (TYPE_SIZE_UNIT (callee_type)) == INTEGER_CST);
  
    var = copy_result_decl_to_var (result, id);
-   if (gimple_referenced_vars (cfun))
-     add_referenced_var (var);
- 
    DECL_SEEN_IN_BIND_EXPR_P (var) = 1;
  
    /* Do not have the rest of GCC warn about this variable as it should
--- 2840,2845 ----
*************** declare_return_variable (copy_body_data
*** 2939,2946 ****
        && !is_gimple_val (var))
      {
        tree temp = create_tmp_var (TREE_TYPE (result), "retvalptr");
-       if (gimple_referenced_vars (cfun))
- 	add_referenced_var (temp);
        insert_decl_map (id, result, temp);
        /* When RESULT_DECL is in SSA form, we need to remap and initialize
  	 it's default_def SSA_NAME.  */
--- 2893,2898 ----
*************** copy_decl_for_dup_finish (copy_body_data
*** 4771,4784 ****
         new function.  */
      DECL_CONTEXT (copy) = id->dst_fn;
  
-   if (TREE_CODE (decl) == VAR_DECL
-       /* C++ clones functions during parsing, before
- 	 referenced_vars.  */
-       && gimple_referenced_vars (DECL_STRUCT_FUNCTION (id->src_fn))
-       && referenced_var_lookup (DECL_STRUCT_FUNCTION (id->src_fn),
- 				DECL_UID (decl)))
-     add_referenced_var (copy);
- 
    return copy;
  }
  
--- 4723,4728 ----
*************** copy_arguments_for_versioning (tree orig
*** 4892,4898 ****
  	   as temporary variable later in function, the uses will be
  	   replaced by local variable.  */
  	tree var = copy_decl_to_var (arg, id);
- 	add_referenced_var (var);
  	insert_decl_map (id, arg, var);
          /* Declare this new variable.  */
          DECL_CHAIN (var) = *vars;
--- 4836,4841 ----
*************** tree_function_versioning (tree old_decl,
*** 5173,5184 ****
  	    if (TREE_CODE (op) == VIEW_CONVERT_EXPR)
  	      op = TREE_OPERAND (op, 0);
  
- 	    if (TREE_CODE (op) == ADDR_EXPR)
- 	      {
- 		op = get_base_address (TREE_OPERAND (op, 0));
- 		if (op && TREE_CODE (op) == VAR_DECL && !is_global_var (op))
- 		  add_referenced_var (op);
- 	      }
  	    gcc_assert (TREE_CODE (replace_info->old_tree) == PARM_DECL);
  	    init = setup_one_parameter (&id, replace_info->old_tree,
  	    			        replace_info->new_tree, id.src_fn,
--- 5116,5121 ----
Index: trunk/gcc/tree-pass.h
===================================================================
*** trunk.orig/gcc/tree-pass.h	2012-08-01 15:13:49.000000000 +0200
--- trunk/gcc/tree-pass.h	2012-08-01 15:15:40.774635978 +0200
*************** struct simple_ipa_opt_pass
*** 142,148 ****
  #define PROP_gimple_lcf		(1 << 1)	/* lowered control flow */
  #define PROP_gimple_leh		(1 << 2)	/* lowered eh */
  #define PROP_cfg		(1 << 3)
- #define PROP_referenced_vars	(1 << 4)
  #define PROP_ssa		(1 << 5)
  #define PROP_no_crit_edges      (1 << 6)
  #define PROP_rtl		(1 << 7)
--- 142,147 ----
*************** extern struct gimple_opt_pass pass_lower
*** 267,273 ****
  extern struct gimple_opt_pass pass_lower_resx;
  extern struct gimple_opt_pass pass_build_cfg;
  extern struct gimple_opt_pass pass_early_tree_profile;
- extern struct gimple_opt_pass pass_referenced_vars;
  extern struct gimple_opt_pass pass_cleanup_eh;
  extern struct gimple_opt_pass pass_sra;
  extern struct gimple_opt_pass pass_sra_early;
--- 266,271 ----
Index: trunk/gcc/tree-profile.c
===================================================================
*** trunk.orig/gcc/tree-profile.c	2012-08-01 15:13:49.000000000 +0200
--- trunk/gcc/tree-profile.c	2012-08-01 15:15:40.774635978 +0200
*************** gimple_gen_edge_profiler (int edgeno, ed
*** 220,226 ****
    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));
-   find_referenced_vars_in (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));
--- 220,225 ----
*************** gimple_gen_interval_profiler (histogram_
*** 267,273 ****
    val = prepare_instrumented_value (&gsi, value);
    call = gimple_build_call (tree_interval_profiler_fn, 4,
  			    ref_ptr, val, start, steps);
-   find_referenced_vars_in (call);
    gsi_insert_before (&gsi, call, GSI_NEW_STMT);
  }
  
--- 266,271 ----
*************** gimple_gen_pow2_profiler (histogram_valu
*** 288,294 ****
  				      true, NULL_TREE, true, GSI_SAME_STMT);
    val = prepare_instrumented_value (&gsi, value);
    call = gimple_build_call (tree_pow2_profiler_fn, 2, ref_ptr, val);
-   find_referenced_vars_in (call);
    gsi_insert_before (&gsi, call, GSI_NEW_STMT);
  }
  
--- 286,291 ----
*************** gimple_gen_one_value_profiler (histogram
*** 309,315 ****
  				      true, NULL_TREE, true, GSI_SAME_STMT);
    val = prepare_instrumented_value (&gsi, value);
    call = gimple_build_call (tree_one_value_profiler_fn, 2, ref_ptr, val);
-   find_referenced_vars_in (call);
    gsi_insert_before (&gsi, call, GSI_NEW_STMT);
  }
  
--- 306,311 ----
*************** gimple_gen_ic_profiler (histogram_value
*** 341,350 ****
  
    tmp1 = create_tmp_reg (ptr_void, "PROF");
    stmt1 = gimple_build_assign (ic_gcov_type_ptr_var, ref_ptr);
-   find_referenced_vars_in (stmt1);
    stmt2 = gimple_build_assign (tmp1, unshare_expr (value->hvalue.value));
    gimple_assign_set_lhs (stmt2, make_ssa_name (tmp1, stmt2));
-   find_referenced_vars_in (stmt2);
    stmt3 = gimple_build_assign (ic_void_ptr_var, gimple_assign_lhs (stmt2));
  
    gsi_insert_before (&gsi, stmt1, GSI_SAME_STMT);
--- 337,344 ----
*************** gimple_gen_average_profiler (histogram_v
*** 439,445 ****
  				      true, GSI_SAME_STMT);
    val = prepare_instrumented_value (&gsi, value);
    call = gimple_build_call (tree_average_profiler_fn, 2, ref_ptr, val);
-   find_referenced_vars_in (call);
    gsi_insert_before (&gsi, call, GSI_NEW_STMT);
  }
  
--- 433,438 ----
*************** gimple_gen_ior_profiler (histogram_value
*** 460,466 ****
  				      true, NULL_TREE, true, GSI_SAME_STMT);
    val = prepare_instrumented_value (&gsi, value);
    call = gimple_build_call (tree_ior_profiler_fn, 2, ref_ptr, val);
-   find_referenced_vars_in (call);
    gsi_insert_before (&gsi, call, GSI_NEW_STMT);
  }
  
--- 453,458 ----
Index: trunk/gcc/tree-ssa-live.c
===================================================================
*** trunk.orig/gcc/tree-ssa-live.c	2012-08-01 15:13:49.000000000 +0200
--- trunk/gcc/tree-ssa-live.c	2012-08-01 15:15:40.775635977 +0200
*************** void
*** 692,699 ****
  remove_unused_locals (void)
  {
    basic_block bb;
!   tree var, t;
!   referenced_var_iterator rvi;
    bitmap global_unused_vars = NULL;
    unsigned srcidx, dstidx, num, ix;
    bool have_local_clobbers = false;
--- 692,698 ----
  remove_unused_locals (void)
  {
    basic_block bb;
!   tree var;
    bitmap global_unused_vars = NULL;
    unsigned srcidx, dstidx, num, ix;
    bool have_local_clobbers = false;
*************** remove_unused_locals (void)
*** 828,834 ****
  	    }
  	  else if (!is_used_p (var))
  	    {
- 	      remove_referenced_var (var);
  	      if (cfun->nonlocal_goto_save_area
  		  && TREE_OPERAND (cfun->nonlocal_goto_save_area, 0) == var)
  		cfun->nonlocal_goto_save_area = NULL;
--- 827,832 ----
*************** remove_unused_locals (void)
*** 847,860 ****
    if (dstidx != num)
      VEC_truncate (tree, cfun->local_decls, dstidx);
  
-   /* ???  We end up with decls in referenced-vars that are not in
-      local-decls.  */
-   FOR_EACH_REFERENCED_VAR (cfun, t, rvi)
-     if (TREE_CODE (t) == VAR_DECL
- 	&& !VAR_DECL_IS_VIRTUAL_OPERAND (t)
- 	&& !is_used_p (t))
-       remove_referenced_var (t);
- 
    remove_unused_scope_block_p (DECL_INITIAL (current_function_decl),
  			       global_unused_vars);
  
--- 845,850 ----
Index: trunk/gcc/tree-cfg.c
===================================================================
*** trunk.orig/gcc/tree-cfg.c	2012-08-01 15:13:49.000000000 +0200
--- trunk/gcc/tree-cfg.c	2012-08-01 15:15:40.789635977 +0200
*************** replace_ssa_name (tree name, struct poin
*** 6048,6056 ****
        replace_by_duplicate_decl (&decl, vars_map, to_context);
  
        push_cfun (DECL_STRUCT_FUNCTION (to_context));
-       if (gimple_in_ssa_p (cfun))
- 	add_referenced_var (decl);
- 
        new_name = make_ssa_name (decl, SSA_NAME_DEF_STMT (name));
        if (SSA_NAME_IS_DEFAULT_DEF (name))
  	set_default_def (decl, new_name);
--- 6048,6053 ----
*************** move_stmt_op (tree *tp, int *walk_subtre
*** 6121,6132 ****
  	  if ((TREE_CODE (t) == VAR_DECL
  	       && !is_global_var (t))
  	      || TREE_CODE (t) == CONST_DECL)
! 	    {
! 	      struct function *to_fn = DECL_STRUCT_FUNCTION (p->to_context);
! 	      replace_by_duplicate_decl (tp, p->vars_map, p->to_context);
! 	      if (gimple_referenced_vars (to_fn))
! 		add_referenced_var_1 (*tp, to_fn);
! 	    }
  	}
        *walk_subtrees = 0;
      }
--- 6118,6124 ----
  	  if ((TREE_CODE (t) == VAR_DECL
  	       && !is_global_var (t))
  	      || TREE_CODE (t) == CONST_DECL)
! 	    replace_by_duplicate_decl (tp, p->vars_map, p->to_context);
  	}
        *walk_subtrees = 0;
      }
Index: trunk/gcc/tree-ssa-operands.c
===================================================================
*** trunk.orig/gcc/tree-ssa-operands.c	2012-08-01 15:13:49.000000000 +0200
--- trunk/gcc/tree-ssa-operands.c	2012-08-01 15:15:40.779635977 +0200
*************** create_vop_var (struct function *fn)
*** 177,183 ****
    TREE_ADDRESSABLE (global_var) = 0;
    VAR_DECL_IS_VIRTUAL_OPERAND (global_var) = 1;
  
-   add_referenced_var_1 (global_var, fn);
    fn->gimple_df->vop = global_var;
  }
  
--- 177,182 ----
Index: trunk/gcc/gimple-low.c
===================================================================
*** trunk.orig/gcc/gimple-low.c	2012-08-01 15:13:48.000000000 +0200
--- trunk/gcc/gimple-low.c	2012-08-01 15:15:40.781635977 +0200
*************** record_vars_into (tree vars, tree fn)
*** 1009,1016 ****
  
        /* Record the variable.  */
        add_local_decl (cfun, var);
-       if (gimple_referenced_vars (cfun))
- 	add_referenced_var (var);
      }
  
    if (fn != current_function_decl)
--- 1009,1014 ----
Index: trunk/gcc/gimplify.c
===================================================================
*** trunk.orig/gcc/gimplify.c	2012-08-01 15:13:48.000000000 +0200
--- trunk/gcc/gimplify.c	2012-08-01 15:15:40.783635977 +0200
*************** void
*** 8363,8369 ****
  gimple_regimplify_operands (gimple stmt, gimple_stmt_iterator *gsi_p)
  {
    size_t i, num_ops;
!   tree orig_lhs = NULL_TREE, lhs, t;
    gimple_seq pre = NULL;
    gimple post_stmt = NULL;
    struct gimplify_ctx gctx;
--- 8363,8369 ----
  gimple_regimplify_operands (gimple stmt, gimple_stmt_iterator *gsi_p)
  {
    size_t i, num_ops;
!   tree orig_lhs = NULL_TREE, lhs;
    gimple_seq pre = NULL;
    gimple post_stmt = NULL;
    struct gimplify_ctx gctx;
*************** gimple_regimplify_operands (gimple stmt,
*** 8522,8531 ****
        break;
      }
  
-   if (gimple_referenced_vars (cfun))
-     for (t = gimplify_ctxp->temps; t ; t = TREE_CHAIN (t))
-       add_referenced_var (t);
- 
    if (!gimple_seq_empty_p (pre))
      gsi_insert_seq_before (gsi_p, pre, GSI_SAME_STMT);
    if (post_stmt)
--- 8522,8527 ----
*************** tree
*** 8542,8548 ****
  force_gimple_operand_1 (tree expr, gimple_seq *stmts,
  			gimple_predicate gimple_test_f, tree var)
  {
-   tree t;
    enum gimplify_status ret;
    struct gimplify_ctx gctx;
  
--- 8538,8543 ----
*************** force_gimple_operand_1 (tree expr, gimpl
*** 8574,8583 ****
        gcc_assert (ret != GS_ERROR);
      }
  
-   if (gimple_referenced_vars (cfun))
-     for (t = gimplify_ctxp->temps; t ; t = DECL_CHAIN (t))
-       add_referenced_var (t);
- 
    pop_gimplify_context (NULL);
  
    return expr;
--- 8569,8574 ----
Index: trunk/gcc/omp-low.c
===================================================================
*** trunk.orig/gcc/omp-low.c	2012-08-01 15:13:48.000000000 +0200
--- trunk/gcc/omp-low.c	2012-08-01 15:15:40.784635977 +0200
*************** expand_omp_for_generic (struct omp_regio
*** 3732,3742 ****
    iend0 = create_tmp_var (fd->iter_type, ".iend0");
    TREE_ADDRESSABLE (istart0) = 1;
    TREE_ADDRESSABLE (iend0) = 1;
-   if (gimple_referenced_vars (cfun))
-     {
-       add_referenced_var (istart0);
-       add_referenced_var (iend0);
-     }
  
    /* See if we need to bias by LLONG_MIN.  */
    if (fd->iter_type == long_long_unsigned_type_node
--- 3732,3737 ----
*************** expand_omp_for_static_chunk (struct omp_
*** 4458,4464 ****
    trip_var = create_tmp_reg (itype, ".trip");
    if (gimple_in_ssa_p (cfun))
      {
-       add_referenced_var (trip_var);
        trip_init = make_ssa_name (trip_var, NULL);
        trip_main = make_ssa_name (trip_var, NULL);
        trip_back = make_ssa_name (trip_var, NULL);
--- 4453,4458 ----
*************** expand_omp_atomic_pipeline (basic_block
*** 5305,5315 ****
        gsi_insert_before (&si, stmt, GSI_SAME_STMT);
        loadedi = create_tmp_var (itype, NULL);
        if (gimple_in_ssa_p (cfun))
! 	{
! 	  add_referenced_var (iaddr);
! 	  add_referenced_var (loadedi);
! 	  loadedi = make_ssa_name (loadedi, NULL);
! 	}
      }
    else
      {
--- 5299,5305 ----
        gsi_insert_before (&si, stmt, GSI_SAME_STMT);
        loadedi = create_tmp_var (itype, NULL);
        if (gimple_in_ssa_p (cfun))
! 	loadedi = make_ssa_name (loadedi, NULL);
      }
    else
      {
*************** expand_omp_atomic_pipeline (basic_block
*** 5386,5393 ****
    else
      {
        old_vali = create_tmp_var (TREE_TYPE (loadedi), NULL);
-       if (gimple_in_ssa_p (cfun))
- 	add_referenced_var (old_vali);
        stmt = gimple_build_assign (old_vali, loadedi);
        gsi_insert_before (&si, stmt, GSI_SAME_STMT);
  
--- 5376,5381 ----
Index: trunk/gcc/graphite-clast-to-gimple.c
===================================================================
*** trunk.orig/gcc/graphite-clast-to-gimple.c	2012-08-01 15:13:48.000000000 +0200
--- trunk/gcc/graphite-clast-to-gimple.c	2012-08-01 15:15:40.786635977 +0200
*************** graphite_create_new_loop (edge entry_edg
*** 949,956 ****
      (entry_edge, lb, stride, ub, ivvar, &iv, &iv_after_increment,
       outer ? outer : entry_edge->src->loop_father);
  
-   add_referenced_var (ivvar);
- 
    mpz_init (low);
    mpz_init (up);
    compute_bounds_for_loop (stmt, low, up);
--- 949,954 ----
*************** translate_clast_assignment (struct clast
*** 1221,1227 ****
    var = create_tmp_var (type, "graphite_var");
    new_name = force_gimple_operand (clast_to_gcc_expression (type, expr, ip),
  				   &stmts, true, var);
-   add_referenced_var (var);
    if (stmts)
      {
        gsi_insert_seq_on_edge (next_e, stmts);
--- 1219,1224 ----
Index: trunk/gcc/graphite-sese-to-poly.c
===================================================================
*** trunk.orig/gcc/graphite-sese-to-poly.c	2012-08-01 15:13:48.000000000 +0200
--- trunk/gcc/graphite-sese-to-poly.c	2012-08-01 15:15:40.786635977 +0200
*************** create_zero_dim_array (tree var, const c
*** 2100,2107 ****
    tree array_type = build_array_type (elt_type, index_type);
    tree base = create_tmp_var (array_type, base_name);
  
-   add_referenced_var (base);
- 
    return build4 (ARRAY_REF, elt_type, base, integer_zero_node, NULL_TREE,
  		 NULL_TREE);
  }
--- 2100,2105 ----
*************** handle_scalar_deps_crossing_scop_limits
*** 2405,2411 ****
        gimple assign = gimple_build_assign (new_name, def);
        gimple_stmt_iterator psi = gsi_after_labels (SESE_EXIT (region)->dest);
  
-       add_referenced_var (var);
        SSA_NAME_DEF_STMT (new_name) = assign;
        update_stmt (assign);
        gsi_insert_before (&psi, assign, GSI_SAME_STMT);
--- 2403,2408 ----
Index: trunk/gcc/ipa-prop.c
===================================================================
*** trunk.orig/gcc/ipa-prop.c	2012-08-01 15:13:48.000000000 +0200
--- trunk/gcc/ipa-prop.c	2012-08-01 15:15:40.787635977 +0200
*************** ipa_modify_formal_parameters (tree fndec
*** 2355,2361 ****
  	  DECL_IGNORED_P (new_parm) = 1;
  	  layout_decl (new_parm, 0);
  
- 	  add_referenced_var (new_parm);
  	  adj->base = parm;
  	  adj->reduction = new_parm;
  
--- 2355,2360 ----
Index: trunk/gcc/ipa-split.c
===================================================================
*** trunk.orig/gcc/ipa-split.c	2012-08-01 15:13:48.000000000 +0200
--- trunk/gcc/ipa-split.c	2012-08-01 15:15:40.787635977 +0200
*************** split_function (struct split_point *spli
*** 1083,1089 ****
        {
  	/* This parm might not have been used up to now, but is going to be
  	   used, hence register it.  */
- 	add_referenced_var (parm);
  	if (is_gimple_reg (parm))
  	  {
  	    arg = gimple_default_def (cfun, parm);
--- 1083,1088 ----
Index: trunk/gcc/matrix-reorg.c
===================================================================
*** trunk.orig/gcc/matrix-reorg.c	2012-08-01 15:13:48.000000000 +0200
--- trunk/gcc/matrix-reorg.c	2012-08-01 15:15:40.787635977 +0200
*************** transform_access_sites (void **slot, voi
*** 1833,1839 ****
  				== MEM_REF);
  		    /* Emit convert statement to convert to type of use.  */
  		    tmp = create_tmp_var (TREE_TYPE (lhs), "new");
- 		    add_referenced_var (tmp);
  		    rhs = gimple_assign_rhs1 (acc_info->stmt);
  		    rhs = fold_convert (TREE_TYPE (tmp),
  					TREE_OPERAND (rhs, 0));
--- 1833,1838 ----
Index: trunk/gcc/trans-mem.c
===================================================================
*** trunk.orig/gcc/trans-mem.c	2012-08-01 15:13:48.000000000 +0200
--- trunk/gcc/trans-mem.c	2012-08-01 15:15:40.788635977 +0200
*************** tm_log_add (basic_block entry_block, tre
*** 1018,1024 ****
  	  && !TREE_ADDRESSABLE (type))
  	{
  	  lp->save_var = create_tmp_reg (TREE_TYPE (lp->addr), "tm_save");
- 	  add_referenced_var (lp->save_var);
  	  lp->stmts = NULL;
  	  lp->entry_block = entry_block;
  	  /* Save addresses separately in dominator order so we don't
--- 1018,1023 ----
*************** ipa_tm_insert_gettmclone_call (struct cg
*** 4455,4461 ****
    gettm_fn = builtin_decl_explicit (safe ? BUILT_IN_TM_GETTMCLONE_SAFE
  				    : BUILT_IN_TM_GETTMCLONE_IRR);
    ret = create_tmp_var (ptr_type_node, NULL);
-   add_referenced_var (ret);
  
    if (!safe)
      transaction_subcode_ior (region, GTMA_MAY_ENTER_IRREVOCABLE);
--- 4454,4459 ----
*************** ipa_tm_insert_gettmclone_call (struct cg
*** 4477,4483 ****
    /* Cast return value from tm_gettmclone* into appropriate function
       pointer.  */
    callfn = create_tmp_var (TREE_TYPE (old_fn), NULL);
-   add_referenced_var (callfn);
    g2 = gimple_build_assign (callfn,
  			    fold_build1 (NOP_EXPR, TREE_TYPE (callfn), ret));
    callfn = make_ssa_name (callfn, g2);
--- 4475,4480 ----
Index: trunk/gcc/tree-complex.c
===================================================================
*** trunk.orig/gcc/tree-complex.c	2012-08-01 15:13:48.000000000 +0200
--- trunk/gcc/tree-complex.c	2012-08-01 15:15:40.789635977 +0200
*************** create_one_component_var (tree type, tre
*** 422,428 ****
  			  const char *suffix, enum tree_code code)
  {
    tree r = create_tmp_var (type, prefix);
-   add_referenced_var (r);
  
    DECL_SOURCE_LOCATION (r) = DECL_SOURCE_LOCATION (orig);
    DECL_ARTIFICIAL (r) = 1;
--- 422,427 ----
Index: trunk/gcc/tree-if-conv.c
===================================================================
*** trunk.orig/gcc/tree-if-conv.c	2012-08-01 15:13:48.000000000 +0200
--- trunk/gcc/tree-if-conv.c	2012-08-01 15:15:40.789635977 +0200
*************** ifc_temp_var (tree type, tree expr, gimp
*** 227,233 ****
  
    /* Create new temporary variable.  */
    var = create_tmp_var (type, name);
-   add_referenced_var (var);
  
    /* Build new statement to assign EXPR to new variable.  */
    stmt = gimple_build_assign (var, expr);
--- 227,232 ----
Index: trunk/gcc/tree-parloops.c
===================================================================
*** trunk.orig/gcc/tree-parloops.c	2012-08-01 15:13:48.000000000 +0200
--- trunk/gcc/tree-parloops.c	2012-08-01 15:15:40.790635977 +0200
*************** take_address_of (tree obj, tree type, ed
*** 482,488 ****
        bvar = create_tmp_var (TREE_TYPE (addr),
  			     get_name (TREE_OPERAND
  				         (TREE_OPERAND (*var_p, 0), 0)));
-       add_referenced_var (bvar);
        stmt = gimple_build_assign (bvar, addr);
        name = make_ssa_name (bvar, stmt);
        gimple_assign_set_lhs (stmt, name);
--- 482,487 ----
*************** initialize_reductions (void **slot, void
*** 540,546 ****
    /* Create a new variable to initialize the reduction.  */
    type = TREE_TYPE (PHI_RESULT (reduc->reduc_phi));
    bvar = create_tmp_var (type, "reduction");
-   add_referenced_var (bvar);
  
    c = build_omp_clause (gimple_location (reduc->reduc_stmt),
  			OMP_CLAUSE_REDUCTION);
--- 539,544 ----
*************** separate_decls_in_region_name (tree name
*** 805,811 ****
      {
        var_copy = create_tmp_var (TREE_TYPE (var), get_name (var));
        DECL_GIMPLE_REG_P (var_copy) = DECL_GIMPLE_REG_P (var);
-       add_referenced_var (var_copy);
        nielt = XNEW (struct int_tree_map);
        nielt->uid = uid;
        nielt->to = var_copy;
--- 803,808 ----
*************** create_call_for_reduction_1 (void **slot
*** 1066,1072 ****
    new_bb = e->dest;
  
    tmp_load = create_tmp_var (TREE_TYPE (TREE_TYPE (addr)), NULL);
-   add_referenced_var (tmp_load);
    tmp_load = make_ssa_name (tmp_load, NULL);
    load = gimple_build_omp_atomic_load (tmp_load, addr);
    SSA_NAME_DEF_STMT (tmp_load) = load;
--- 1063,1068 ----
*************** separate_decls_in_region (edge entry, ed
*** 1352,1360 ****
  
        /* Create the loads and stores.  */
        *arg_struct = create_tmp_var (type, ".paral_data_store");
-       add_referenced_var (*arg_struct);
        nvar = create_tmp_var (build_pointer_type (type), ".paral_data_load");
-       add_referenced_var (nvar);
        *new_arg_struct = make_ssa_name (nvar, NULL);
  
        ld_st_data->store = *arg_struct;
--- 1348,1354 ----
Index: trunk/gcc/tree-predcom.c
===================================================================
*** trunk.orig/gcc/tree-predcom.c	2012-08-01 15:13:48.000000000 +0200
--- trunk/gcc/tree-predcom.c	2012-08-01 15:15:40.790635977 +0200
*************** predcom_tmp_var (tree ref, unsigned i, b
*** 1452,1459 ****
    /* We never access the components of the temporary variable in predictive
       commoning.  */
    tree var = create_tmp_reg (type, get_lsm_tmp_name (ref, i));
- 
-   add_referenced_var (var);
    bitmap_set_bit (tmp_vars, DECL_UID (var));
    return var;
  }
--- 1452,1457 ----
*************** reassociate_to_the_same_stmt (tree name1
*** 2193,2204 ****
    /* Insert the new statement combining NAME1 and NAME2 before S1, and
       combine it with the rhs of S1.  */
    var = create_tmp_reg (type, "predreastmp");
-   add_referenced_var (var);
    new_name = make_ssa_name (var, NULL);
    new_stmt = gimple_build_assign_with_ops (code, new_name, name1, name2);
  
    var = create_tmp_reg (type, "predreastmp");
-   add_referenced_var (var);
    tmp_name = make_ssa_name (var, NULL);
  
    /* Rhs of S1 may now be either a binary expression with operation
--- 2191,2200 ----
Index: trunk/gcc/tree-sra.c
===================================================================
*** trunk.orig/gcc/tree-sra.c	2012-08-01 15:13:48.000000000 +0200
--- trunk/gcc/tree-sra.c	2012-08-01 15:15:40.791635977 +0200
*************** build_ref_for_offset (location_t loc, tr
*** 1449,1455 ****
  
        gcc_checking_assert (gsi);
        tmp = create_tmp_reg (build_pointer_type (TREE_TYPE (prev_base)), NULL);
-       add_referenced_var (tmp);
        tmp = make_ssa_name (tmp, NULL);
        addr = build_fold_addr_expr (unshare_expr (prev_base));
        STRIP_USELESS_TYPE_CONVERSION (addr);
--- 1449,1454 ----
*************** create_access_replacement (struct access
*** 1851,1858 ****
    tree repl;
  
    repl = create_tmp_var (access->type, "SR");
-   add_referenced_var (repl);
- 
    if (TREE_CODE (access->type) == COMPLEX_TYPE
        || TREE_CODE (access->type) == VECTOR_TYPE)
      {
--- 1850,1855 ----
*************** get_replaced_param_substitute (struct ip
*** 4183,4189 ****
        DECL_NAME (repl) = get_identifier (pretty_name);
        obstack_free (&name_obstack, pretty_name);
  
-       add_referenced_var (repl);
        adj->new_ssa_base = repl;
      }
    else
--- 4180,4185 ----
*************** sra_ipa_reset_debug_stmts (ipa_parm_adju
*** 4567,4573 ****
  	  SET_DECL_RTL (copy, 0);
  	  TREE_USED (copy) = 1;
  	  DECL_CONTEXT (copy) = current_function_decl;
- 	  add_referenced_var (copy);
  	  add_local_decl (cfun, copy);
  	  DECL_CHAIN (copy) =
  	    BLOCK_VARS (DECL_INITIAL (current_function_decl));
--- 4563,4568 ----
Index: trunk/gcc/tree-ssa-loop-im.c
===================================================================
*** trunk.orig/gcc/tree-ssa-loop-im.c	2012-08-01 15:13:48.000000000 +0200
--- trunk/gcc/tree-ssa-loop-im.c	2012-08-01 15:27:40.752611051 +0200
*************** rewrite_reciprocal (gimple_stmt_iterator
*** 942,950 ****
    lhs = gimple_assign_lhs (stmt);
    type = TREE_TYPE (lhs);
  
!   var = create_tmp_var (type, "reciptmp");
!   add_referenced_var (var);
!   DECL_GIMPLE_REG_P (var) = 1;
  
    real_one = build_one_cst (type);
  
--- 942,948 ----
    lhs = gimple_assign_lhs (stmt);
    type = TREE_TYPE (lhs);
  
!   var = create_tmp_reg (type, "reciptmp");
  
    real_one = build_one_cst (type);
  
*************** rewrite_bittest (gimple_stmt_iterator *b
*** 1024,1030 ****
  
        /* 1 << B */
        var = create_tmp_var (TREE_TYPE (a), "shifttmp");
-       add_referenced_var (var);
        t = fold_build2 (LSHIFT_EXPR, TREE_TYPE (a),
  		       build_int_cst (TREE_TYPE (a), 1), b);
        stmt1 = gimple_build_assign (var, t);
--- 1022,1027 ----
Index: trunk/gcc/tree-ssa-loop-ivopts.c
===================================================================
*** trunk.orig/gcc/tree-ssa-loop-ivopts.c	2012-08-01 15:13:48.000000000 +0200
--- trunk/gcc/tree-ssa-loop-ivopts.c	2012-08-01 15:15:40.792635977 +0200
*************** create_new_iv (struct ivopts_data *data,
*** 6032,6038 ****
      }
  
    gimple_add_tmp_var (cand->var_before);
-   add_referenced_var (cand->var_before);
  
    base = unshare_expr (cand->iv->base);
  
--- 6032,6037 ----
Index: trunk/gcc/tree-ssa-loop-manip.c
===================================================================
*** trunk.orig/gcc/tree-ssa-loop-manip.c	2012-08-01 15:13:48.000000000 +0200
--- trunk/gcc/tree-ssa-loop-manip.c	2012-08-01 15:15:40.792635977 +0200
*************** create_iv (tree base, tree step, tree va
*** 56,65 ****
    edge pe = loop_preheader_edge (loop);
  
    if (!var)
!     {
!       var = create_tmp_var (TREE_TYPE (base), "ivtmp");
!       add_referenced_var (var);
!     }
  
    vb = make_ssa_name (var, NULL);
    if (var_before)
--- 56,62 ----
    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)
*************** tree_transform_and_unroll_loop (struct l
*** 1009,1023 ****
  					     TREE_TYPE (next)))
  	var = SSA_NAME_VAR (init);
        else if (useless_type_conversion_p (TREE_TYPE (next), TREE_TYPE (init)))
! 	{
! 	  var = create_tmp_var (TREE_TYPE (next), "unrinittmp");
! 	  add_referenced_var (var);
! 	}
        else
! 	{
! 	  var = create_tmp_var (TREE_TYPE (init), "unrinittmp");
! 	  add_referenced_var (var);
! 	}
  
        new_init = make_ssa_name (var, NULL);
        phi_rest = create_phi_node (new_init, rest);
--- 1006,1014 ----
  					     TREE_TYPE (next)))
  	var = SSA_NAME_VAR (init);
        else if (useless_type_conversion_p (TREE_TYPE (next), TREE_TYPE (init)))
! 	var = create_tmp_var (TREE_TYPE (next), "unrinittmp");
        else
! 	var = create_tmp_var (TREE_TYPE (init), "unrinittmp");
  
        new_init = make_ssa_name (var, NULL);
        phi_rest = create_phi_node (new_init, rest);
Index: trunk/gcc/tree-ssa-math-opts.c
===================================================================
*** trunk.orig/gcc/tree-ssa-math-opts.c	2012-08-01 15:13:48.000000000 +0200
--- trunk/gcc/tree-ssa-math-opts.c	2012-08-01 15:15:40.793635977 +0200
*************** powi_as_mults (gimple_stmt_iterator *gsi
*** 989,996 ****
    cache[1] = arg0;
  
    target = create_tmp_reg (type, "powmult");
-   add_referenced_var (target);
- 
    result = powi_as_mults_1 (gsi, loc, type, (n < 0) ? -n : n, cache, target);
  
    if (n >= 0)
--- 989,994 ----
*************** build_and_insert_call (gimple_stmt_itera
*** 1041,1050 ****
    tree ssa_target;
  
    if (!*var)
!     {
!       *var = create_tmp_reg (TREE_TYPE (arg), "powroot");
!       add_referenced_var (*var);
!     }
  
    call_stmt = gimple_build_call (fn, 1, arg);
    ssa_target = make_ssa_name (*var, NULL);
--- 1039,1045 ----
    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_expand_builtin_cabs (gimple_stmt_
*** 1354,1361 ****
      return NULL_TREE;
  
    target = create_tmp_reg (type, "cabs");
-   add_referenced_var (target);
- 
    real_part = build_and_insert_ref (gsi, loc, type, target,
  				    REALPART_EXPR, arg);
    addend1 = build_and_insert_binop (gsi, loc, target, MULT_EXPR,
--- 1349,1354 ----
*************** execute_optimize_bswap (void)
*** 1900,1906 ****
  	      gimple convert_stmt;
  
  	      bswap_tmp = create_tmp_var (bswap_type, "bswapsrc");
- 	      add_referenced_var (bswap_tmp);
  	      bswap_tmp = make_ssa_name (bswap_tmp, NULL);
  
  	      convert_stmt = gimple_build_assign_with_ops (
--- 1893,1898 ----
*************** execute_optimize_bswap (void)
*** 1918,1924 ****
  	      gimple convert_stmt;
  
  	      bswap_tmp = create_tmp_var (bswap_type, "bswapdst");
- 	      add_referenced_var (bswap_tmp);
  	      bswap_tmp = make_ssa_name (bswap_tmp, NULL);
  	      convert_stmt = gimple_build_assign_with_ops (
  		               CONVERT_EXPR, gimple_assign_lhs (stmt), bswap_tmp, NULL);
--- 1910,1915 ----
Index: trunk/gcc/tree-ssa-phiopt.c
===================================================================
*** trunk.orig/gcc/tree-ssa-phiopt.c	2012-08-01 15:13:48.000000000 +0200
--- trunk/gcc/tree-ssa-phiopt.c	2012-08-01 15:15:40.793635977 +0200
*************** conditional_replacement (basic_block con
*** 691,697 ****
        source_location locus_0, locus_1;
  
        new_var2 = create_tmp_var (TREE_TYPE (result), NULL);
-       add_referenced_var (new_var2);
        new_stmt = gimple_build_assign_with_ops (CONVERT_EXPR, new_var2,
  					       new_var, NULL);
        new_var2 = make_ssa_name (new_var2, new_stmt);
--- 691,696 ----
*************** abs_replacement (basic_block cond_bb, ba
*** 1215,1221 ****
    if (negate)
      {
        tree tmp = create_tmp_var (TREE_TYPE (result), NULL);
-       add_referenced_var (tmp);
        lhs = make_ssa_name (tmp, NULL);
      }
    else
--- 1214,1219 ----
*************** cond_store_replacement (basic_block midd
*** 1482,1488 ****
          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");
-   add_referenced_var (condstoretemp);
  
    /* 3) Insert a load from the memory of the store to the temporary
          on the edge which did not contain the store.  */
--- 1480,1485 ----
*************** cond_if_else_store_replacement_1 (basic_
*** 1567,1573 ****
  	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");
-   add_referenced_var (condstoretemp);
  
    /* 3) Create a PHI node at the join block, with one argument
  	holding the old RHS, and the other holding the temporary
--- 1564,1569 ----
Index: trunk/gcc/tree-ssa-phiprop.c
===================================================================
*** trunk.orig/gcc/tree-ssa-phiprop.c	2012-08-01 15:13:48.000000000 +0200
--- trunk/gcc/tree-ssa-phiprop.c	2012-08-01 15:15:40.793635977 +0200
*************** phiprop_insert_phi (basic_block bb, gimp
*** 196,202 ****
  						  old_arg,
  						  TREE_OPERAND (rhs, 1)));
  	  gcc_assert (is_gimple_reg (new_var));
- 	  add_referenced_var (new_var);
  	  new_var = make_ssa_name (new_var, tmp);
  	  gimple_assign_set_lhs (tmp, new_var);
  	  gimple_set_location (tmp, locus);
--- 196,201 ----
Index: trunk/gcc/tree-ssa-pre.c
===================================================================
*** trunk.orig/gcc/tree-ssa-pre.c	2012-08-01 15:13:48.000000000 +0200
--- trunk/gcc/tree-ssa-pre.c	2012-08-01 15:15:40.794635977 +0200
*************** get_representative_for (const pre_expr e
*** 1411,1420 ****
    /* 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");
!       add_referenced_var (pretemp);
!     }
  
    name = make_ssa_name (pretemp, gimple_build_nop ());
    VN_INFO_GET (name)->value_id = value_id;
--- 1411,1417 ----
    /* 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;
*************** create_expression_by_pieces (basic_block
*** 3110,3116 ****
      pretemp = create_tmp_reg (exprtype, "pretmp");
  
    temp = pretemp;
-   add_referenced_var (temp);
  
    newstmt = gimple_build_assign (temp, folded);
    name = make_ssa_name (temp, newstmt);
--- 3107,3112 ----
*************** insert_into_preds_of_block (basic_block
*** 3369,3375 ****
      prephitemp = create_tmp_var (type, "prephitmp");
  
    temp = prephitemp;
-   add_referenced_var (temp);
  
    if (TREE_CODE (type) == COMPLEX_TYPE
        || TREE_CODE (type) == VECTOR_TYPE)
--- 3365,3370 ----
Index: trunk/gcc/tree-ssa-propagate.c
===================================================================
*** trunk.orig/gcc/tree-ssa-propagate.c	2012-08-01 15:13:48.000000000 +0200
--- trunk/gcc/tree-ssa-propagate.c	2012-08-01 15:15:40.794635977 +0200
*************** update_call_from_tree (gimple_stmt_itera
*** 793,799 ****
            STRIP_USELESS_TYPE_CONVERSION (expr);
            lhs = create_tmp_var (TREE_TYPE (expr), NULL);
            new_stmt = gimple_build_assign (lhs, expr);
-           add_referenced_var (lhs);
  	  if (gimple_in_ssa_p (cfun))
  	    lhs = make_ssa_name (lhs, new_stmt);
            gimple_assign_set_lhs (new_stmt, lhs);
--- 793,798 ----
Index: trunk/gcc/tree-ssa-reassoc.c
===================================================================
*** trunk.orig/gcc/tree-ssa-reassoc.c	2012-08-01 15:13:48.000000000 +0200
--- trunk/gcc/tree-ssa-reassoc.c	2012-08-01 15:15:40.794635977 +0200
*************** undistribute_ops_list (enum tree_code op
*** 1433,1439 ****
  	      print_generic_expr (dump_file, oe1->op, 0);
  	    }
  	  tmpvar = create_tmp_reg (TREE_TYPE (oe1->op), NULL);
- 	  add_referenced_var (tmpvar);
  	  zero_one_operation (&oe1->op, c->oecode, c->op);
  	  EXECUTE_IF_SET_IN_SBITMAP (candidates2, first+1, i, sbi0)
  	    {
--- 1433,1438 ----
*************** eliminate_redundant_comparison (enum tre
*** 1598,1604 ****
  	  tree newop2;
  	  gcc_assert (COMPARISON_CLASS_P (t));
  	  tmpvar = create_tmp_var (TREE_TYPE (t), NULL);
- 	  add_referenced_var (tmpvar);
  	  extract_ops_from_tree (t, &subcode, &newop1, &newop2);
  	  STRIP_USELESS_TYPE_CONVERSION (newop1);
  	  STRIP_USELESS_TYPE_CONVERSION (newop2);
--- 1597,1602 ----
*************** rewrite_expr_tree_parallel (gimple stmt,
*** 2454,2460 ****
      stmts[i] = SSA_NAME_DEF_STMT (gimple_assign_rhs1 (stmts[i+1]));
  
    lhs_var = create_tmp_reg (TREE_TYPE (last_rhs1), NULL);
-   add_referenced_var (lhs_var);
  
    for (i = 0; i < stmt_num; i++)
      {
--- 2452,2457 ----
*************** static tree
*** 3086,3095 ****
  get_reassoc_pow_ssa_name (tree *target, tree type)
  {
    if (!*target || !types_compatible_p (type, TREE_TYPE (*target)))
!     {
!       *target = create_tmp_reg (type, "reassocpow");
!       add_referenced_var (*target);
!     }
  
    return make_ssa_name (*target, NULL);
  }
--- 3083,3089 ----
  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);
  }
Index: trunk/gcc/tree-ssa-strlen.c
===================================================================
*** trunk.orig/gcc/tree-ssa-strlen.c	2012-08-01 15:13:48.000000000 +0200
--- trunk/gcc/tree-ssa-strlen.c	2012-08-01 15:15:40.795635977 +0200
*************** get_string_length (strinfo si)
*** 416,422 ****
  	  fn = builtin_decl_implicit (BUILT_IN_STRLEN);
  	  gcc_assert (lhs == NULL_TREE);
  	  lhs_var = create_tmp_var (TREE_TYPE (TREE_TYPE (fn)), NULL);
- 	  add_referenced_var (lhs_var);
  	  tem = unshare_expr (gimple_call_arg (stmt, 0));
  	  lenstmt = gimple_build_call (fn, 1, tem);
  	  lhs = make_ssa_name (lhs_var, lenstmt);
--- 416,421 ----
*************** get_string_length (strinfo si)
*** 425,431 ****
  	  gsi_insert_before (&gsi, lenstmt, GSI_SAME_STMT);
  	  lhs_var = create_tmp_var (TREE_TYPE (gimple_call_arg (stmt, 0)),
  				    NULL);
- 	  add_referenced_var (lhs_var);
  	  tem = gimple_call_arg (stmt, 0);
            if (!ptrofftype_p (TREE_TYPE (lhs)))
              {
--- 424,429 ----
*************** get_string_length (strinfo si)
*** 455,461 ****
  	    }
  	  gimple_call_set_fndecl (stmt, fn);
  	  lhs_var = create_tmp_var (TREE_TYPE (TREE_TYPE (fn)), NULL);
- 	  add_referenced_var (lhs_var);
  	  lhs = make_ssa_name (lhs_var, stmt);
  	  gimple_call_set_lhs (stmt, lhs);
  	  update_stmt (stmt);
--- 453,458 ----
Index: trunk/gcc/tree-switch-conversion.c
===================================================================
*** trunk.orig/gcc/tree-switch-conversion.c	2012-08-01 15:13:48.000000000 +0200
--- trunk/gcc/tree-switch-conversion.c	2012-08-01 15:15:40.795635977 +0200
*************** emit_case_bit_tests (gimple swtch, tree
*** 425,431 ****
  
    /* csui = (1 << (word_mode) idx) */
    tmp = create_tmp_var (word_type_node, "csui");
-   add_referenced_var (tmp);
    csui = make_ssa_name (tmp, NULL);
    tmp = fold_build2 (LSHIFT_EXPR, word_type_node, word_mode_one,
  		     fold_convert (word_type_node, idx));
--- 425,430 ----
*************** build_arrays (gimple swtch, struct switc
*** 1109,1115 ****
  
    arr_index_type = build_index_type (info->range_size);
    tmp = create_tmp_var (utype, "csui");
-   add_referenced_var (tmp);
    tidx = make_ssa_name (tmp, NULL);
    sub = fold_build2_loc (loc, MINUS_EXPR, utype,
  			 fold_convert_loc (loc, utype, info->index_expr),
--- 1108,1113 ----
Index: trunk/gcc/tree-tailcall.c
===================================================================
*** trunk.orig/gcc/tree-tailcall.c	2012-08-01 15:13:48.000000000 +0200
--- trunk/gcc/tree-tailcall.c	2012-08-01 15:15:40.795635977 +0200
*************** adjust_return_value_with_ops (enum tree_
*** 613,620 ****
    gimple stmt;
    tree result;
  
-   add_referenced_var (tmp);
- 
    if (types_compatible_p (TREE_TYPE (acc), TREE_TYPE (op1)))
      stmt = gimple_build_assign_with_ops (code, tmp, acc, op1);
    else
--- 613,618 ----
*************** create_tailcall_accumulator (const char
*** 912,918 ****
    tree tmp = create_tmp_reg (ret_type, label);
    gimple phi;
  
-   add_referenced_var (tmp);
    phi = create_phi_node (tmp, bb);
    /* RET_TYPE can be a float when -ffast-maths is enabled.  */
    add_phi_arg (phi, fold_convert (ret_type, init), single_pred_edge (bb),
--- 910,915 ----
Index: trunk/gcc/tree-vect-data-refs.c
===================================================================
*** trunk.orig/gcc/tree-vect-data-refs.c	2012-08-01 15:13:48.000000000 +0200
--- trunk/gcc/tree-vect-data-refs.c	2012-08-01 15:15:40.796635977 +0200
*************** vect_get_new_vect_var (tree type, enum v
*** 3432,3438 ****
      }
    else
      new_vect_var = create_tmp_reg (type, prefix);
-   add_referenced_var (new_vect_var);
  
    return new_vect_var;
  }
--- 3432,3437 ----
*************** vect_create_addr_base_for_vector_ref (gi
*** 3512,3518 ****
      }
  
    data_ref_base_var = create_tmp_var (TREE_TYPE (data_ref_base), "batmp");
-   add_referenced_var (data_ref_base_var);
    data_ref_base = force_gimple_operand (data_ref_base, &seq, true,
  					data_ref_base_var);
    gimple_seq_add_seq (new_stmt_list, seq);
--- 3511,3516 ----
*************** vect_create_addr_base_for_vector_ref (gi
*** 3522,3528 ****
  			    fold_convert (sizetype, base_offset),
  			    fold_convert (sizetype, init));
    dest = create_tmp_var (sizetype, "base_off");
-   add_referenced_var (dest);
    base_offset = force_gimple_operand (base_offset, &seq, true, dest);
    gimple_seq_add_seq (new_stmt_list, seq);
  
--- 3520,3525 ----
*************** vect_create_addr_base_for_vector_ref (gi
*** 3530,3536 ****
      {
        tree tmp = create_tmp_var (sizetype, "offset");
  
-       add_referenced_var (tmp);
        offset = fold_build2 (MULT_EXPR, sizetype,
  			    fold_convert (sizetype, offset), step);
        base_offset = fold_build2 (PLUS_EXPR, sizetype,
--- 3527,3532 ----
*************** vect_permute_store_chain (VEC(tree,heap)
*** 4168,4174 ****
  	  /* Create interleaving stmt:
  	     high = VEC_PERM_EXPR <vect1, vect2, {0, nelt, 1, nelt+1, ...}>  */
  	  perm_dest = create_tmp_reg (vectype, "vect_inter_high");
- 	  add_referenced_var (perm_dest);
  	  high = make_ssa_name (perm_dest, NULL);
  	  perm_stmt
  	    = gimple_build_assign_with_ops3 (VEC_PERM_EXPR, high,
--- 4164,4169 ----
*************** vect_permute_store_chain (VEC(tree,heap)
*** 4180,4186 ****
  	     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");
- 	  add_referenced_var (perm_dest);
  	  low = make_ssa_name (perm_dest, NULL);
  	  perm_stmt
  	    = gimple_build_assign_with_ops3 (VEC_PERM_EXPR, low,
--- 4175,4180 ----
*************** vect_permute_load_chain (VEC(tree,heap)
*** 4623,4629 ****
  
  	  /* data_ref = permute_even (first_data_ref, second_data_ref);  */
  	  perm_dest = create_tmp_reg (vectype, "vect_perm_even");
- 	  add_referenced_var (perm_dest);
  
  	  perm_stmt = gimple_build_assign_with_ops3 (VEC_PERM_EXPR, perm_dest,
  						     first_vect, second_vect,
--- 4617,4622 ----
*************** vect_permute_load_chain (VEC(tree,heap)
*** 4637,4643 ****
  
  	  /* data_ref = permute_odd (first_data_ref, second_data_ref);  */
  	  perm_dest = create_tmp_reg (vectype, "vect_perm_odd");
- 	  add_referenced_var (perm_dest);
  
  	  perm_stmt = gimple_build_assign_with_ops3 (VEC_PERM_EXPR, perm_dest,
  						     first_vect, second_vect,
--- 4630,4635 ----
Index: trunk/gcc/tree-vect-generic.c
===================================================================
*** trunk.orig/gcc/tree-vect-generic.c	2012-08-01 15:13:48.000000000 +0200
--- trunk/gcc/tree-vect-generic.c	2012-08-01 15:15:40.796635977 +0200
*************** expand_vector_divmod (gimple_stmt_iterat
*** 668,674 ****
  					 << shifts[i]) - 1);
  	      cst = build_vector (type, vec);
  	      addend = create_tmp_reg (type, NULL);
- 	      add_referenced_var (addend);
  	      addend = make_ssa_name (addend, NULL);
  	      stmt = gimple_build_assign_with_ops3 (VEC_COND_EXPR, addend,
  						    cond, cst, zero);
--- 668,673 ----
Index: trunk/gcc/tree-vect-loop-manip.c
===================================================================
*** trunk.orig/gcc/tree-vect-loop-manip.c	2012-08-01 15:13:48.000000000 +0200
--- trunk/gcc/tree-vect-loop-manip.c	2012-08-01 15:15:40.797635977 +0200
*************** set_prologue_iterations (basic_block bb_
*** 1078,1084 ****
  
    var = create_tmp_var (TREE_TYPE (scalar_loop_iters),
  			"prologue_after_cost_adjust");
-   add_referenced_var (var);
    prologue_after_cost_adjust_name =
      force_gimple_operand (scalar_loop_iters, &stmts, false, var);
  
--- 1078,1083 ----
*************** vect_build_loop_niters (loop_vec_info lo
*** 1497,1503 ****
    tree ni = unshare_expr (LOOP_VINFO_NITERS (loop_vinfo));
  
    var = create_tmp_var (TREE_TYPE (ni), "niters");
-   add_referenced_var (var);
    ni_name = force_gimple_operand (ni, &stmts, false, var);
  
    pe = loop_preheader_edge (loop);
--- 1496,1501 ----
*************** vect_generate_tmps_on_preheader (loop_ve
*** 1564,1570 ****
        if (!is_gimple_val (ni_minus_gap_name))
  	{
  	  var = create_tmp_var (TREE_TYPE (ni), "ni_gap");
-           add_referenced_var (var);
  
            stmts = NULL;
            ni_minus_gap_name = force_gimple_operand (ni_minus_gap_name, &stmts,
--- 1562,1567 ----
*************** vect_generate_tmps_on_preheader (loop_ve
*** 1589,1595 ****
    if (!is_gimple_val (ratio_name))
      {
        var = create_tmp_var (TREE_TYPE (ni), "bnd");
-       add_referenced_var (var);
  
        stmts = NULL;
        ratio_name = force_gimple_operand (ratio_name, &stmts, true, var);
--- 1586,1591 ----
*************** vect_generate_tmps_on_preheader (loop_ve
*** 1610,1616 ****
    if (!is_gimple_val (ratio_mult_vf_name))
      {
        var = create_tmp_var (TREE_TYPE (ni), "ratio_mult_vf");
-       add_referenced_var (var);
  
        stmts = NULL;
        ratio_mult_vf_name = force_gimple_operand (ratio_mult_vf_name, &stmts,
--- 1606,1611 ----
*************** vect_update_ivs_after_vectorizer (loop_v
*** 1835,1841 ****
  			  init_expr, fold_convert (type, off));
  
        var = create_tmp_var (type, "tmp");
-       add_referenced_var (var);
  
        last_gsi = gsi_last_bb (exit_bb);
        ni_name = force_gimple_operand_gsi (&last_gsi, ni, false, var,
--- 1830,1835 ----
*************** vect_gen_niters_for_prolog_loop (loop_ve
*** 2041,2047 ****
      }
  
    var = create_tmp_var (niters_type, "prolog_loop_niters");
-   add_referenced_var (var);
    stmts = NULL;
    iters_name = force_gimple_operand (iters, &stmts, false, var);
  
--- 2035,2040 ----
*************** vect_do_peeling_for_alignment (loop_vec_
*** 2159,2165 ****
        edge pe = loop_preheader_edge (loop);
        tree wide_iters = fold_convert (sizetype, niters_of_prolog_loop);
        tree var = create_tmp_var (sizetype, "prolog_loop_adjusted_niters");
-       add_referenced_var (var);
        wide_prolog_niters = force_gimple_operand (wide_iters, &seq, false,
                                                   var);
        if (seq)
--- 2152,2157 ----
*************** vect_create_cond_for_align_checks (loop_
*** 2257,2263 ****
  
        sprintf (tmp_name, "%s%d", "addr2int", i);
        addr_tmp = create_tmp_reg (int_ptrsize_type, tmp_name);
-       add_referenced_var (addr_tmp);
        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);
--- 2249,2254 ----
*************** vect_create_cond_for_align_checks (loop_
*** 2271,2277 ****
            /* create: or_tmp = or_tmp | addr_tmp */
            sprintf (tmp_name, "%s%d", "orptrs", i);
            or_tmp = create_tmp_reg (int_ptrsize_type, tmp_name);
-           add_referenced_var (or_tmp);
  	  new_or_tmp_name = make_ssa_name (or_tmp, NULL);
  	  or_stmt = gimple_build_assign_with_ops (BIT_IOR_EXPR,
  						  new_or_tmp_name,
--- 2262,2267 ----
*************** vect_create_cond_for_align_checks (loop_
*** 2289,2295 ****
  
    /* create: and_tmp = or_tmp & mask  */
    and_tmp = create_tmp_reg (int_ptrsize_type, "andmask" );
-   add_referenced_var (and_tmp);
    and_tmp_name = make_ssa_name (and_tmp, NULL);
  
    and_stmt = gimple_build_assign_with_ops (BIT_AND_EXPR, and_tmp_name,
--- 2279,2284 ----
Index: trunk/gcc/tree-vect-patterns.c
===================================================================
*** trunk.orig/gcc/tree-vect-patterns.c	2012-08-01 15:13:48.000000000 +0200
--- trunk/gcc/tree-vect-patterns.c	2012-08-01 15:15:40.797635977 +0200
*************** static tree
*** 207,214 ****
  vect_recog_temp_ssa_var (tree type, gimple stmt)
  {
    tree var = create_tmp_reg (type, "patt");
- 
-   add_referenced_var (var);
    var = make_ssa_name (var, stmt);
    return var;
  }
--- 207,212 ----
*************** vect_handle_widen_op_by_const (gimple st
*** 502,508 ****
        /* Create a_T = (NEW_TYPE) a_t;  */
        *oprnd = gimple_assign_rhs1 (def_stmt);
        tmp = create_tmp_reg (new_type, NULL);
-       add_referenced_var (tmp);
        new_oprnd = make_ssa_name (tmp, NULL);
        new_stmt = gimple_build_assign_with_ops (NOP_EXPR, new_oprnd, *oprnd,
  					       NULL_TREE);
--- 500,505 ----
*************** vect_operation_fits_smaller_type (gimple
*** 1107,1113 ****
                /* Create NEW_OPRND = (INTERM_TYPE) OPRND.  */
                oprnd = gimple_assign_rhs1 (def_stmt);
                tmp = create_tmp_reg (interm_type, NULL);
-               add_referenced_var (tmp);
                new_oprnd = make_ssa_name (tmp, NULL);
                new_stmt = gimple_build_assign_with_ops (NOP_EXPR, new_oprnd,
                                                         oprnd, NULL_TREE);
--- 1104,1109 ----
*************** vect_operation_fits_smaller_type (gimple
*** 1128,1134 ****
          {
            /* Create a type conversion HALF_TYPE->INTERM_TYPE.  */
            tmp = create_tmp_reg (interm_type, NULL);
-           add_referenced_var (tmp);
            new_oprnd = make_ssa_name (tmp, NULL);
            new_stmt = gimple_build_assign_with_ops (NOP_EXPR, new_oprnd,
                                                     oprnd, NULL_TREE);
--- 1124,1129 ----
*************** vect_recog_over_widening_pattern (VEC (g
*** 1260,1266 ****
          {
            /* Create NEW_TYPE->USE_TYPE conversion.  */
            tmp = create_tmp_reg (use_type, NULL);
-           add_referenced_var (tmp);
            new_oprnd = make_ssa_name (tmp, NULL);
            pattern_stmt = gimple_build_assign_with_ops (NOP_EXPR, new_oprnd,
                                                         var, NULL_TREE);
--- 1255,1260 ----
Index: trunk/gcc/tree-vect-stmts.c
===================================================================
*** trunk.orig/gcc/tree-vect-stmts.c	2012-08-01 15:13:48.000000000 +0200
--- trunk/gcc/tree-vect-stmts.c	2012-08-01 15:15:40.798635977 +0200
*************** vect_init_vector (gimple stmt, tree val,
*** 1271,1277 ****
  	  else
  	    {
  	      new_var = create_tmp_reg (TREE_TYPE (type), NULL);
- 	      add_referenced_var (new_var);
  	      init_stmt = gimple_build_assign_with_ops (NOP_EXPR,
  							new_var, val,
  							NULL_TREE);
--- 1271,1276 ----

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH][2/2] Remove referenced vars
  2012-08-01 13:38 [PATCH][2/2] Remove referenced vars Richard Guenther
@ 2012-08-02  8:13 ` Richard Guenther
  2012-08-05 23:59   ` H.J. Lu
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Guenther @ 2012-08-02  8:13 UTC (permalink / raw)
  To: gcc-patches; +Cc: aldyh

On Wed, 1 Aug 2012, Richard Guenther wrote:

> 
> This is the combined patch, ontop of 2a and 2b this removes all
> gimple_referenced_vars and add_referenced_vars calls.
> 
> Bootstrapped on x86_64-unknown-linux-gnu, testing in progress.
> 
> GCC is a better place w/o referenced vars ;)

Re-bootstrapped and tested on x86_64-unknown-linux-gnu ontop of
what has been actually committed.  Adjusted a few dump-scans in
points-to analysis.  This will also result in

FAIL: gcc.dg/pr52558-1.c scan-tree-dump-times lim1 "MEM count_lsm.. 
count_lsm_fl
ag" 1
FAIL: gcc.dg/pr52558-2.c scan-tree-dump-times lim1 "MEM.*g_2_lsm_flag" 1
FAIL: gcc.dg/tm/reg-promotion.c scan-tree-dump-times lim1 "MEM count_lsm.. 
count
_lsm_flag" 1

as I could not figure out what to replace the previously senseless
dump scanning with.  There are no changelog entries for the addition
of these testcases, so I'm not sure whom to nag.  gcc.dg/pr52558-1.c
was committed by Aldyh at least.  Aldyh - these tests scan for random
strings and in no way guarantee that the store remains to be executed
conditional only.  Maybe you should amend the lim dump in case you
want to only ensure that the lim transform uses conditional replacement?

Committed to trunk.

Richard.

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

	* tree-dfa.c (referenced_var_lookup): Remove.
	(find_referenced_vars): Remove.
	(pass_referenced_vars): Likewise.
	(make_rename_temp): Do not add referenced vars.
	(dump_referenced_vars): Remove.
	(debug_referenced_vars): Likewise.
	(dump_dfa_stats): Do not dump referenced var stats.
	(find_vars_r): Remove.
	(find_referenced_vars_in): Likewise.
	(referenced_var_check_and_insert): Likewise.
	(add_referenced_var_1): Likewise.
	(remove_referenced_var): Likewise.
	* tree-flow.h (referenced_var_lookup): Likewise.
	(struct gimple_df): Remove referenced_vars member.
	(typedef referenced_var_iterator): Remove.
	(FOR_EACH_REFERENCED_VAR): Likewise.
	(num_referenced_vars): Likewise.
	(debug_referenced_vars, dump_referenced_vars): Likewise.
	(add_referenced_var_1, add_referenced_var): Likewise.
	(remove_referenced_var): Likewise.
	(find_referenced_vars_in): Likewise.
	* tree-flow-inline.h (gimple_referenced_vars): Remove.
	(first_referenced_var): Likewise.
	(end_referenced_vars_p): Likewise.
	(next_referenced_var): Likewise.
	* cfgexpand.c (update_alias_info_with_stack_vars): Remove assert.
	* gimple-pretty-print.c (pp_points_to_solution): Dump UIDs
	unconditionally.
	* tree-into-ssa.c (dump_decl_set): Likewise.
	(pass_build_ssa): Do not require PROP_referenced_vars.
	* tree-ssa.c (target_for_debug_bind): Virtual operands are
	not suitable, but all register type vars are.
	(init_tree_ssa): Do not allocate referenced vars.
	(delete_tree_ssa): Do not free referenced vars.
	* cgraphunit.c (init_lowered_empty_function): Do not set
	PROP_referenced_vars.
	(assemble_thunk): Do not add referenced vars.
	* gimple-fold.c (canonicalize_constructor_val): Likewise.
	(gimplify_and_update_call_from_tree): Likewise.
	* gimple-streamer-in.c (input_bb): Likewise.
	* passes.c (init_optimization_passes): Do not run
	pass_referenced_vars.
	(dump_properties): Do not dump PROP_referenced_vars.
	* tree-inline.c (remap_decl): Do not add referenced vars.
	(remap_gimple_op_r): Likewise.
	(copy_tree_body_r): Likewise.
	(copy_bb): Likewise.
	(setup_one_parameter): Likewise.
	(declare_return_variable): Likewise.
	(copy_decl_for_dup_finish): Likewise.
	(copy_arguments_for_versioning): Likewise.
	(tree_function_versioning): Likewise.
	* tree-pass.h (PROP_referenced_vars): Remove.
	(pass_referenced_vars): Likewise.
	* tree-profile.c (gimple_gen_edge_profiler): Do not add referenced vars.
	(gimple_gen_interval_profiler): Likewise.
	(gimple_gen_pow2_profiler): Likewise.
	(gimple_gen_one_value_profiler): Likewise.
	(gimple_gen_ic_profiler): Likewise.
	(gimple_gen_average_profiler): Likewise.
	(gimple_gen_ior_profiler): Likewise.
	* tree-ssa-live.c (remove_unused_locals): Do not touch referenced vars.
	* tree-cfg.c (replace_ssa_name): Do not add referenced vars.
	(move_stmt_op): Likewise.
	* tree-ssa-operands.c (create_vop_var): Likewise.
	* gimple-low.c (record_vars_into): Likewise.
	* gimplify.c (gimple_regimplify_operands): Likewise.
	(force_gimple_operand_1): Likewise.
	* omp-low.c (expand_omp_for_generic): Likewise.
	(expand_omp_for_static_chunk): Likewise.
	(expand_omp_atomic_pipeline): Likewise.
	* graphite-clast-to-gimple.c (graphite_create_new_loop): Likewise.
	(translate_clast_assignment): Likewise.
	* graphite-sese-to-poly.c (create_zero_dim_array): Likewise.
	(handle_scalar_deps_crossing_scop_limits): Likewise.
	* ipa-prop.c (ipa_modify_formal_parameters): Likewise.
	* ipa-split.c (split_function): Likewise.
	* matrix-reorg.c (transform_access_sites): Likewise.
	* trans-mem.c (tm_log_add): Likewise.
	(ipa_tm_insert_gettmclone_call): Likewise.
	* tree-complex.c (create_one_component_var): Likewise.
	* tree-if-conv.c (ifc_temp_var): Likewise.
	* tree-parloops.c (take_address_of): Likewise.
	(initialize_reductions): Likewise.
	(separate_decls_in_region_name): Likewise.
	(create_call_for_reduction_1): Likewise.
	(separate_decls_in_region): Likewise.
	* tree-predcom.c (predcom_tmp_var): Likewise.
	(reassociate_to_the_same_stmt): Likewise.
	* tree-sra.c (build_ref_for_offset): Likewise.
	(create_access_replacement): Likewise.
	(get_replaced_param_substitute): Likewise.
	(sra_ipa_reset_debug_stmts): Likewise.
	* tree-ssa-loop-im.c (rewrite_reciprocal): Likewise.
	(rewrite_bittest): Likewise.
	* tree-ssa-loop-ivopts.c (create_new_iv): Likewise.
	* tree-ssa-loop-manip.c (create_iv): Likewise.
	(tree_transform_and_unroll_loop): Likewise.
	* tree-ssa-math-opts.c (powi_as_mults): Likewise.
	(build_and_insert_call): Likewise.
	(gimple_expand_builtin_cabs): Likewise.
	(execute_optimize_bswap): Likewise.
	* tree-ssa-phiopt.c (conditional_replacement): Likewise.
	(abs_replacement): Likewise.
	(cond_store_replacement): Likewise.
	(cond_if_else_store_replacement_1): Likewise.
	* tree-ssa-phiprop.c (phiprop_insert_phi): Likewise.
	* tree-ssa-pre.c (get_representative_for): Likewise.
	(create_expression_by_pieces): Likewise.
	(insert_into_preds_of_block): Likewise.
	* tree-ssa-propagate.c (update_call_from_tree): Likewise.
	* tree-ssa-reassoc.c (undistribute_ops_list): Likewise.
	(eliminate_redundant_comparison): Likewise.
	(rewrite_expr_tree_parallel): Likewise.
	(get_reassoc_pow_ssa_name): Likewise.
	* tree-ssa-strlen.c (get_string_length): Likewise.
	* 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-data-refs.c (vect_get_new_vect_var): Likewise.
	(vect_create_addr_base_for_vector_ref): Likewise.
	(vect_permute_store_chain): Likewise.
	(vect_permute_load_chain): Likewise.
	* tree-vect-generic.c (expand_vector_divmod): Likewise.
	* tree-vect-loop-manip.c (set_prologue_iterations): Likewise.
	(vect_build_loop_niters): Likewise.
	(vect_generate_tmps_on_preheader): Likewise.
	(vect_update_ivs_after_vectorizer): Likewise.
	(vect_gen_niters_for_prolog_loop): Likewise.
	(vect_do_peeling_for_alignment): Likewise.
	(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.

	* gcc.dg/torture/pta-callused-1.c: Adjust.
	* gcc.dg/torture/pta-ptrarith-3.c: Likewise.
	* gcc.dg/torture/ssa-pta-fn-1.c: Likewise.
	* gcc.dg/tree-ssa/alias-19.c: Likewise.
	* gcc.dg/tree-ssa/pta-escape-1.c: Likewise.
	* gcc.dg/tree-ssa/pta-escape-2.c: Likewise.
	* gcc.dg/tree-ssa/pta-escape-3.c: Likewise.
	* gcc.dg/tree-ssa/pta-ptrarith-1.c: Likewise.
	* gcc.dg/tree-ssa/pta-ptrarith-2.c: Likewise.

Index: trunk/gcc/cfgexpand.c
===================================================================
*** trunk.orig/gcc/cfgexpand.c	2012-08-01 15:35:52.000000000 +0200
--- trunk/gcc/cfgexpand.c	2012-08-01 15:36:58.926591724 +0200
*************** update_alias_info_with_stack_vars (void)
*** 620,632 ****
  	{
  	  tree decl = stack_vars[j].decl;
  	  unsigned int uid = DECL_PT_UID (decl);
- 	  /* We should never end up partitioning SSA names (though they
- 	     may end up on the stack).  Neither should we allocate stack
- 	     space to something that is unused and thus unreferenced, except
- 	     for -O0 where we are preserving even unreferenced variables.  */
- 	  gcc_assert (DECL_P (decl)
- 		      && (!optimize
- 			  || referenced_var_lookup (cfun, DECL_UID (decl))));
  	  bitmap_set_bit (part, uid);
  	  *((bitmap *) pointer_map_insert (decls_to_partitions,
  					   (void *)(size_t) uid)) = part;
--- 620,625 ----
Index: trunk/gcc/gimple-pretty-print.c
===================================================================
*** trunk.orig/gcc/gimple-pretty-print.c	2012-08-01 15:35:52.000000000 +0200
--- trunk/gcc/gimple-pretty-print.c	2012-08-01 15:36:58.927591724 +0200
*************** pp_points_to_solution (pretty_printer *b
*** 597,617 ****
        pp_string (buffer, "{ ");
        EXECUTE_IF_SET_IN_BITMAP (pt->vars, 0, i, bi)
  	{
! 	  tree var = referenced_var_lookup (cfun, i);
! 	  if (var)
! 	    {
! 	      dump_generic_node (buffer, var, 0, dump_flags, false);
! 	      if (DECL_PT_UID (var) != DECL_UID (var))
! 		{
! 		  pp_string (buffer, "ptD.");
! 		  pp_decimal_int (buffer, DECL_PT_UID (var));
! 		}
! 	    }
! 	  else
! 	    {
! 	      pp_string (buffer, "D.");
! 	      pp_decimal_int (buffer, i);
! 	    }
  	  pp_character (buffer, ' ');
  	}
        pp_character (buffer, '}');
--- 597,604 ----
        pp_string (buffer, "{ ");
        EXECUTE_IF_SET_IN_BITMAP (pt->vars, 0, i, bi)
  	{
! 	  pp_string (buffer, "D.");
! 	  pp_decimal_int (buffer, i);
  	  pp_character (buffer, ' ');
  	}
        pp_character (buffer, '}');
Index: trunk/gcc/tree-dfa.c
===================================================================
*** trunk.orig/gcc/tree-dfa.c	2012-08-01 15:36:56.000000000 +0200
--- trunk/gcc/tree-dfa.c	2012-08-01 15:36:58.928591724 +0200
*************** static void collect_dfa_stats (struct df
*** 63,118 ****
  /*---------------------------------------------------------------------------
  			Dataflow analysis (DFA) routines
  ---------------------------------------------------------------------------*/
- /* Find all the variables referenced in the function.  This function
-    builds the global arrays REFERENCED_VARS and CALL_CLOBBERED_VARS.
- 
-    Note that this function does not look for statement operands, it simply
-    determines what variables are referenced in the program and detects
-    various attributes for each variable used by alias analysis and the
-    optimizer.  */
- 
- static unsigned int
- find_referenced_vars (void)
- {
-   basic_block bb;
-   gimple_stmt_iterator si;
- 
-   FOR_EACH_BB (bb)
-     {
-       for (si = gsi_start_bb (bb); !gsi_end_p (si); gsi_next (&si))
- 	{
- 	  gimple stmt = gsi_stmt (si);
- 	  if (is_gimple_debug (stmt))
- 	    continue;
- 	  find_referenced_vars_in (gsi_stmt (si));
- 	}
- 
-       for (si = gsi_start_phis (bb); !gsi_end_p (si); gsi_next (&si))
- 	find_referenced_vars_in (gsi_stmt (si));
-     }
- 
-   return 0;
- }
- 
- struct gimple_opt_pass pass_referenced_vars =
- {
-  {
-   GIMPLE_PASS,
-   "*referenced_vars",			/* name */
-   NULL,					/* gate */
-   find_referenced_vars,			/* execute */
-   NULL,					/* sub */
-   NULL,					/* next */
-   0,					/* static_pass_number */
-   TV_FIND_REFERENCED_VARS,		/* tv_id */
-   PROP_gimple_leh | PROP_cfg,		/* properties_required */
-   PROP_referenced_vars,			/* properties_provided */
-   0,					/* properties_destroyed */
-   0,                     		/* todo_flags_start */
-   0                                     /* todo_flags_finish */
-  }
- };
- 
  
  /* Renumber all of the gimple stmt uids.  */
  
--- 63,68 ----
*************** renumber_gimple_stmt_uids_in_blocks (bas
*** 169,180 ****
  tree
  make_rename_temp (tree type, const char *prefix)
  {
!   tree t = create_tmp_reg (type, prefix);
! 
!   if (gimple_referenced_vars (cfun))
!     add_referenced_var (t);
! 
!   return t;
  }
  
  
--- 119,125 ----
  tree
  make_rename_temp (tree type, const char *prefix)
  {
!   return create_tmp_reg (type, prefix);
  }
  
  
*************** make_rename_temp (tree type, const char
*** 182,217 ****
  /*---------------------------------------------------------------------------
  			      Debugging functions
  ---------------------------------------------------------------------------*/
- /* Dump the list of all the referenced variables in the current function to
-    FILE.  */
- 
- void
- dump_referenced_vars (FILE *file)
- {
-   tree var;
-   referenced_var_iterator rvi;
- 
-   fprintf (file, "\nReferenced variables in %s: %u\n\n",
- 	   get_name (current_function_decl), (unsigned) num_referenced_vars);
- 
-   FOR_EACH_REFERENCED_VAR (cfun, var, rvi)
-     {
-       fprintf (file, "Variable: ");
-       dump_variable (file, var);
-     }
- 
-   fprintf (file, "\n");
- }
- 
- 
- /* Dump the list of all the referenced variables to stderr.  */
- 
- DEBUG_FUNCTION void
- debug_referenced_vars (void)
- {
-   dump_referenced_vars (stderr);
- }
- 
  
  /* Dump variable VAR and its may-aliases to FILE.  */
  
--- 127,132 ----
*************** dump_dfa_stats (FILE *file)
*** 297,307 ****
    fprintf (file, fmt_str, "", "  instances  ", "used ");
    fprintf (file, "---------------------------------------------------------\n");
  
-   size = num_referenced_vars * sizeof (tree);
-   total += size;
-   fprintf (file, fmt_str_1, "Referenced variables", (unsigned long)num_referenced_vars,
- 	   SCALE (size), LABEL (size));
- 
    size = dfa_stats.num_uses * sizeof (tree *);
    total += size;
    fprintf (file, fmt_str_1, "USE operands", dfa_stats.num_uses,
--- 212,217 ----
*************** collect_dfa_stats (struct dfa_stats_d *d
*** 397,493 ****
  /*---------------------------------------------------------------------------
  			     Miscellaneous helpers
  ---------------------------------------------------------------------------*/
- /* Callback for walk_tree.  Used to collect variables referenced in
-    the function.  */
- 
- static tree
- find_vars_r (tree *tp, int *walk_subtrees, void *data)
- {
-   struct function *fn = (struct function *) data;
- 
-   /* If we are reading the lto info back in, we need to rescan the
-      referenced vars.  */
-   if (TREE_CODE (*tp) == SSA_NAME)
-     add_referenced_var_1 (SSA_NAME_VAR (*tp), fn);
- 
-   /* If T is a regular variable that the optimizers are interested
-      in, add it to the list of variables.  */
-   else if ((TREE_CODE (*tp) == VAR_DECL
- 	    && !is_global_var (*tp))
- 	   || TREE_CODE (*tp) == PARM_DECL
- 	   || TREE_CODE (*tp) == RESULT_DECL)
-     add_referenced_var_1 (*tp, fn);
- 
-   /* Type, _DECL and constant nodes have no interesting children.
-      Ignore them.  */
-   else if (IS_TYPE_OR_DECL_P (*tp) || CONSTANT_CLASS_P (*tp))
-     *walk_subtrees = 0;
- 
-   return NULL_TREE;
- }
- 
- /* Find referenced variables in STMT.  */
- 
- void
- find_referenced_vars_in (gimple stmt)
- {
-   size_t i;
- 
-   if (gimple_code (stmt) != GIMPLE_PHI)
-     {
-       for (i = 0; i < gimple_num_ops (stmt); i++)
- 	walk_tree (gimple_op_ptr (stmt, i), find_vars_r, cfun, NULL);
-     }
-   else
-     {
-       walk_tree (gimple_phi_result_ptr (stmt), find_vars_r, cfun, NULL);
- 
-       for (i = 0; i < gimple_phi_num_args (stmt); i++)
- 	{
- 	  tree arg = gimple_phi_arg_def (stmt, i);
- 	  walk_tree (&arg, find_vars_r, cfun, NULL);
- 	}
-     }
- }
- 
- 
- /* Lookup UID in the referenced_vars hashtable and return the associated
-    variable.  */
- 
- tree
- referenced_var_lookup (struct function *fn, unsigned int uid)
- {
-   tree h;
-   struct tree_decl_minimal in;
-   in.uid = uid;
-   h = (tree) htab_find_with_hash (gimple_referenced_vars (fn), &in, uid);
-   return h;
- }
- 
- /* Check if TO is in the referenced_vars hash table and insert it if not.
-    Return true if it required insertion.  */
- 
- static bool
- referenced_var_check_and_insert (tree to, struct function *fn)
- {
-   tree *loc;
-   struct tree_decl_minimal in;
-   unsigned int uid = DECL_UID (to);
- 
-   in.uid = uid;
-   loc = (tree *) htab_find_slot_with_hash (gimple_referenced_vars (fn),
- 					   &in, uid, INSERT);
-   if (*loc)
-     {
-       /* DECL_UID has already been entered in the table.  Verify that it is
- 	 the same entry as TO.  See PR 27793.  */
-       gcc_assert (*loc == to);
-       return false;
-     }
- 
-   *loc = to;
-   return true;
- }
  
  /* Lookup VAR UID in the default_defs hashtable and return the associated
     variable.  */
--- 307,312 ----
*************** set_default_def (tree var, tree def)
*** 536,585 ****
     SSA_NAME_IS_DEFAULT_DEF (def) = true;
  }
  
- /* Add VAR to the list of referenced variables if it isn't already there.  */
- 
- bool
- add_referenced_var_1 (tree var, struct function *fn)
- {
-   gcc_checking_assert (TREE_CODE (var) == VAR_DECL
- 		       || TREE_CODE (var) == PARM_DECL
- 		       || TREE_CODE (var) == RESULT_DECL);
- 
-   gcc_checking_assert ((TREE_CODE (var) == VAR_DECL
- 			&& VAR_DECL_IS_VIRTUAL_OPERAND (var))
- 		       || !is_global_var (var));
- 
-   /* Insert VAR into the referenced_vars hash table if it isn't present
-      and allocate its var-annotation.  */
-   if (referenced_var_check_and_insert (var, fn))
-     return true;
- 
-   return false;
- }
- 
- /* Remove VAR from the list of referenced variables and clear its
-    var-annotation.  */
- 
- void
- remove_referenced_var (tree var)
- {
-   struct tree_decl_minimal in;
-   void **loc;
-   unsigned int uid = DECL_UID (var);
- 
-   gcc_checking_assert (TREE_CODE (var) == VAR_DECL
- 		       || TREE_CODE (var) == PARM_DECL
- 		       || TREE_CODE (var) == RESULT_DECL);
- 
-   gcc_checking_assert (!is_global_var (var));
- 
-   in.uid = uid;
-   loc = htab_find_slot_with_hash (gimple_referenced_vars (cfun), &in, uid,
- 				  NO_INSERT);
-   if (loc)
-     htab_clear_slot (gimple_referenced_vars (cfun), loc);
- }
- 
  
  /* If EXP is a handled component reference for a structure, return the
     base variable.  The access range is delimited by bit positions *POFFSET and
--- 355,360 ----
Index: trunk/gcc/tree-flow.h
===================================================================
*** trunk.orig/gcc/tree-flow.h	2012-08-01 15:36:56.000000000 +0200
--- trunk/gcc/tree-flow.h	2012-08-01 15:36:58.929591724 +0200
*************** struct GTY(()) tm_restart_node {
*** 45,53 ****
     gimple_ accessor defined in tree-flow-inline.h, all publicly modifiable
     fields should have gimple_set accessor.  */
  struct GTY(()) gimple_df {
-   /* Array of all variables referenced in the function.  */
-   htab_t GTY((param_is (union tree_node))) referenced_vars;
- 
    /* A vector of all the noreturn calls passed to modify_stmt.
       cleanup_control_flow uses it to detect cases where a mid-block
       indirect call has been turned into a noreturn call.  When this
--- 45,50 ----
*************** extern int int_tree_map_eq (const void *
*** 292,315 ****
  extern unsigned int uid_decl_map_hash (const void *);
  extern int uid_decl_map_eq (const void *, const void *);
  
- typedef struct
- {
-   htab_iterator hti;
- } referenced_var_iterator;
- 
- /* This macro loops over all the referenced vars, one at a time, putting the
-    current var in VAR.  Note:  You are not allowed to add referenced variables
-    to the hashtable while using this macro.  Doing so may cause it to behave
-    erratically.  */
- 
- #define FOR_EACH_REFERENCED_VAR(FN, VAR, ITER)		\
-   for ((VAR) = first_referenced_var ((FN), &(ITER));	\
-        !end_referenced_vars_p (&(ITER));		\
-        (VAR) = next_referenced_var (&(ITER)))
- 
- extern tree referenced_var_lookup (struct function *, unsigned int);
- #define num_referenced_vars htab_elements (gimple_referenced_vars (cfun))
- 
  #define num_ssa_names (VEC_length (tree, cfun->gimple_df->ssa_names))
  #define ssa_name(i) (VEC_index (tree, cfun->gimple_df->ssa_names, (i)))
  
--- 289,294 ----
*************** extern void renumber_gimple_stmt_uids (v
*** 463,481 ****
  extern void renumber_gimple_stmt_uids_in_blocks (basic_block *, int);
  extern void dump_dfa_stats (FILE *);
  extern void debug_dfa_stats (void);
- extern void debug_referenced_vars (void);
- extern void dump_referenced_vars (FILE *);
  extern void dump_variable (FILE *, tree);
  extern void debug_variable (tree);
- extern bool add_referenced_var_1 (tree, struct function *);
- #define add_referenced_var(v) add_referenced_var_1 ((v), cfun)
- extern void remove_referenced_var (tree);
  extern tree make_rename_temp (tree, const char *);
  extern void set_default_def (tree, tree);
  extern tree gimple_default_def (struct function *, tree);
  extern bool stmt_references_abnormal_ssa_name (gimple);
  extern tree get_addr_base_and_unit_offset (tree, HOST_WIDE_INT *);
- extern void find_referenced_vars_in (gimple);
  extern void dump_enumerated_decls (FILE *, int);
  
  /* In tree-phinodes.c  */
--- 442,454 ----
Index: trunk/gcc/tree-into-ssa.c
===================================================================
*** trunk.orig/gcc/tree-into-ssa.c	2012-08-01 15:36:56.000000000 +0200
--- trunk/gcc/tree-into-ssa.c	2012-08-01 15:36:58.930591724 +0200
*************** dump_decl_set (FILE *file, bitmap set)
*** 1551,1561 ****
  
        EXECUTE_IF_SET_IN_BITMAP (set, 0, i, bi)
  	{
! 	  tree var = referenced_var_lookup (cfun, i);
! 	  if (var)
! 	    print_generic_expr (file, var, 0);
! 	  else
! 	    fprintf (file, "D.%u", i);
  	  fprintf (file, " ");
  	}
  
--- 1551,1557 ----
  
        EXECUTE_IF_SET_IN_BITMAP (set, 0, i, bi)
  	{
! 	  fprintf (file, "D.%u", i);
  	  fprintf (file, " ");
  	}
  
*************** struct gimple_opt_pass pass_build_ssa =
*** 2467,2473 ****
    NULL,					/* next */
    0,					/* static_pass_number */
    TV_TREE_SSA_OTHER,			/* tv_id */
!   PROP_cfg | PROP_referenced_vars,	/* properties_required */
    PROP_ssa,				/* properties_provided */
    0,					/* properties_destroyed */
    0,					/* todo_flags_start */
--- 2463,2469 ----
    NULL,					/* next */
    0,					/* static_pass_number */
    TV_TREE_SSA_OTHER,			/* tv_id */
!   PROP_cfg,				/* properties_required */
    PROP_ssa,				/* properties_provided */
    0,					/* properties_destroyed */
    0,					/* todo_flags_start */
Index: trunk/gcc/tree-ssa.c
===================================================================
*** trunk.orig/gcc/tree-ssa.c	2012-08-01 15:36:56.000000000 +0200
--- trunk/gcc/tree-ssa.c	2012-08-01 15:36:58.931591724 +0200
*************** target_for_debug_bind (tree var)
*** 249,255 ****
    if (!MAY_HAVE_DEBUG_STMTS)
      return NULL_TREE;
  
!   if (TREE_CODE (var) != VAR_DECL
        && TREE_CODE (var) != PARM_DECL)
      return NULL_TREE;
  
--- 249,256 ----
    if (!MAY_HAVE_DEBUG_STMTS)
      return NULL_TREE;
  
!   if ((TREE_CODE (var) != VAR_DECL
!        || VAR_DECL_IS_VIRTUAL_OPERAND (var))
        && TREE_CODE (var) != PARM_DECL)
      return NULL_TREE;
  
*************** target_for_debug_bind (tree var)
*** 259,271 ****
    if (DECL_IGNORED_P (var))
      return NULL_TREE;
  
!   if (!is_gimple_reg (var))
!     {
!       if (is_gimple_reg_type (TREE_TYPE (var))
! 	  && referenced_var_lookup (cfun, DECL_UID (var)) == NULL_TREE)
! 	return var;
!       return NULL_TREE;
!     }
  
    return var;
  }
--- 260,268 ----
    if (DECL_IGNORED_P (var))
      return NULL_TREE;
  
!   /* var-tracking only tracks registers.  */
!   if (!is_gimple_reg_type (TREE_TYPE (var)))
!     return NULL_TREE;
  
    return var;
  }
*************** void
*** 1107,1114 ****
  init_tree_ssa (struct function *fn)
  {
    fn->gimple_df = ggc_alloc_cleared_gimple_df ();
-   fn->gimple_df->referenced_vars = htab_create_ggc (20, uid_decl_map_hash,
- 				     		    uid_decl_map_eq, NULL);
    fn->gimple_df->default_defs = htab_create_ggc (20, uid_ssaname_map_hash,
  				                 uid_ssaname_map_eq, NULL);
    pt_solution_reset (&fn->gimple_df->escaped);
--- 1104,1109 ----
*************** struct gimple_opt_pass pass_init_datastr
*** 1150,1159 ****
  void
  delete_tree_ssa (void)
  {
-   /* Remove annotations from every referenced local variable.  */
-   htab_delete (gimple_referenced_vars (cfun));
-   cfun->gimple_df->referenced_vars = NULL;
- 
    fini_ssanames ();
  
    /* We no longer maintain the SSA operand cache at this point.  */
--- 1145,1150 ----
Index: trunk/gcc/cgraphunit.c
===================================================================
*** trunk.orig/gcc/cgraphunit.c	2012-08-01 15:35:52.000000000 +0200
--- trunk/gcc/cgraphunit.c	2012-08-01 15:36:58.932591724 +0200
*************** init_lowered_empty_function (tree decl)
*** 1228,1235 ****
  
    DECL_SAVED_TREE (decl) = error_mark_node;
    cfun->curr_properties |=
!     (PROP_gimple_lcf | PROP_gimple_leh | PROP_cfg | PROP_referenced_vars |
!      PROP_ssa | PROP_gimple_any);
  
    /* Create BB for body of the function and connect it properly.  */
    bb = create_basic_block (NULL, (void *) 0, ENTRY_BLOCK_PTR);
--- 1228,1234 ----
  
    DECL_SAVED_TREE (decl) = error_mark_node;
    cfun->curr_properties |=
!     (PROP_gimple_lcf | PROP_gimple_leh | PROP_cfg | PROP_ssa | PROP_gimple_any);
  
    /* Create BB for body of the function and connect it properly.  */
    bb = create_basic_block (NULL, (void *) 0, ENTRY_BLOCK_PTR);
*************** assemble_thunk (struct cgraph_node *node
*** 1454,1465 ****
  				      virtual_offset));
        else
          VEC_quick_push (tree, vargs, a);
-       add_referenced_var (a);
        for (i = 1, arg = DECL_CHAIN (a); i < nargs; i++, arg = DECL_CHAIN (arg))
! 	{
! 	  add_referenced_var (arg);
! 	  VEC_quick_push (tree, vargs, arg);
! 	}
        call = gimple_build_call_vec (build_fold_addr_expr_loc (0, alias), vargs);
        VEC_free (tree, heap, vargs);
        gimple_call_set_from_thunk (call, true);
--- 1453,1460 ----
  				      virtual_offset));
        else
          VEC_quick_push (tree, vargs, a);
        for (i = 1, arg = DECL_CHAIN (a); i < nargs; i++, arg = DECL_CHAIN (arg))
! 	VEC_quick_push (tree, vargs, arg);
        call = gimple_build_call_vec (build_fold_addr_expr_loc (0, alias), vargs);
        VEC_free (tree, heap, vargs);
        gimple_call_set_from_thunk (call, true);
Index: trunk/gcc/gimple-fold.c
===================================================================
*** trunk.orig/gcc/gimple-fold.c	2012-08-01 15:35:52.000000000 +0200
--- trunk/gcc/gimple-fold.c	2012-08-01 15:36:58.933591723 +0200
*************** canonicalize_constructor_val (tree cval,
*** 169,180 ****
  	  && !can_refer_decl_in_current_unit_p (base, from_decl))
  	return NULL_TREE;
        if (TREE_CODE (base) == VAR_DECL)
! 	{
! 	  TREE_ADDRESSABLE (base) = 1;
! 	  if (cfun && gimple_referenced_vars (cfun)
! 	      && !is_global_var (base))
! 	    add_referenced_var (base);
! 	}
        else if (TREE_CODE (base) == FUNCTION_DECL)
  	{
  	  /* Make sure we create a cgraph node for functions we'll reference.
--- 169,175 ----
  	  && !can_refer_decl_in_current_unit_p (base, from_decl))
  	return NULL_TREE;
        if (TREE_CODE (base) == VAR_DECL)
! 	TREE_ADDRESSABLE (base) = 1;
        else if (TREE_CODE (base) == FUNCTION_DECL)
  	{
  	  /* Make sure we create a cgraph node for functions we'll reference.
*************** gimplify_and_update_call_from_tree (gimp
*** 653,661 ****
    for (i = gsi_start (stmts); !gsi_end_p (i); gsi_next (&i))
      {
        new_stmt = gsi_stmt (i);
-       /* The replacement can expose previously unreferenced variables.  */
-       if (gimple_in_ssa_p (cfun))
- 	find_referenced_vars_in (new_stmt);
        /* If the new statement possibly has a VUSE, update it with exact SSA
  	 name we know will reach this one.  */
        if (gimple_has_mem_ops (new_stmt))
--- 648,653 ----
Index: trunk/gcc/gimple-streamer-in.c
===================================================================
*** trunk.orig/gcc/gimple-streamer-in.c	2012-08-01 15:35:52.000000000 +0200
--- trunk/gcc/gimple-streamer-in.c	2012-08-01 15:36:58.933591723 +0200
*************** input_bb (struct lto_input_block *ib, en
*** 310,317 ****
    while (tag)
      {
        gimple stmt = input_gimple_stmt (ib, data_in, fn, tag);
-       if (!is_gimple_debug (stmt))
- 	find_referenced_vars_in (stmt);
        gsi_insert_after (&bsi, stmt, GSI_NEW_STMT);
  
        /* After the statement, expect a 0 delimiter or the EH region
--- 310,315 ----
*************** input_bb (struct lto_input_block *ib, en
*** 332,339 ****
    tag = streamer_read_record_start (ib);
    while (tag)
      {
!       gimple phi = input_phi (ib, bb, data_in, fn);
!       find_referenced_vars_in (phi);
        tag = streamer_read_record_start (ib);
      }
  }
--- 330,336 ----
    tag = streamer_read_record_start (ib);
    while (tag)
      {
!       input_phi (ib, bb, data_in, fn);
        tag = streamer_read_record_start (ib);
      }
  }
Index: trunk/gcc/passes.c
===================================================================
*** trunk.orig/gcc/passes.c	2012-08-01 15:35:52.000000000 +0200
--- trunk/gcc/passes.c	2012-08-01 15:36:58.933591723 +0200
*************** init_optimization_passes (void)
*** 1285,1291 ****
        NEXT_PASS (pass_init_datastructures);
        NEXT_PASS (pass_expand_omp);
  
-       NEXT_PASS (pass_referenced_vars);
        NEXT_PASS (pass_build_ssa);
        NEXT_PASS (pass_lower_vector);
        NEXT_PASS (pass_early_warn_uninitialized);
--- 1285,1290 ----
*************** dump_properties (FILE *dump, unsigned in
*** 2603,2610 ****
      fprintf (dump, "PROP_gimple_leh\n");
    if (props & PROP_cfg)
      fprintf (dump, "PROP_cfg\n");
-   if (props & PROP_referenced_vars)
-     fprintf (dump, "PROP_referenced_vars\n");
    if (props & PROP_ssa)
      fprintf (dump, "PROP_ssa\n");
    if (props & PROP_no_crit_edges)
--- 2602,2607 ----
Index: trunk/gcc/tree-flow-inline.h
===================================================================
*** trunk.orig/gcc/tree-flow-inline.h	2012-08-01 15:36:57.000000000 +0200
--- trunk/gcc/tree-flow-inline.h	2012-08-01 15:36:58.934591723 +0200
*************** gimple_in_ssa_p (const struct function *
*** 35,49 ****
    return fun && fun->gimple_df && fun->gimple_df->in_ssa_p;
  }
  
- /* Array of all variables referenced in the function.  */
- static inline htab_t
- gimple_referenced_vars (const struct function *fun)
- {
-   if (!fun || !fun->gimple_df)
-     return NULL;
-   return fun->gimple_df->referenced_vars;
- }
- 
  /* Artificial variable used for the virtual operand FUD chain.  */
  static inline tree
  gimple_vop (const struct function *fun)
--- 35,40 ----
*************** next_htab_element (htab_iterator *hti)
*** 98,131 ****
    return NULL;
  }
  
- /* Initialize ITER to point to the first referenced variable in the
-    referenced_vars hashtable, and return that variable.  */
- 
- static inline tree
- first_referenced_var (struct function *fn, referenced_var_iterator *iter)
- {
-   return (tree) first_htab_element (&iter->hti,
- 				    gimple_referenced_vars (fn));
- }
- 
- /* Return true if we have hit the end of the referenced variables ITER is
-    iterating through.  */
- 
- static inline bool
- end_referenced_vars_p (const referenced_var_iterator *iter)
- {
-   return end_htab_p (&iter->hti);
- }
- 
- /* Make ITER point to the next referenced_var in the referenced_var hashtable,
-    and return that variable.  */
- 
- static inline tree
- next_referenced_var (referenced_var_iterator *iter)
- {
-   return (tree) next_htab_element (&iter->hti);
- }
- 
  /* Get the number of the next statement uid to be allocated.  */
  static inline unsigned int
  gimple_stmt_max_uid (struct function *fn)
--- 89,94 ----
Index: trunk/gcc/tree-inline.c
===================================================================
*** trunk.orig/gcc/tree-inline.c	2012-08-01 15:36:56.000000000 +0200
--- trunk/gcc/tree-inline.c	2012-08-01 15:36:58.934591723 +0200
*************** remap_decl (tree decl, copy_body_data *i
*** 338,354 ****
  	    walk_tree (&DECL_QUALIFIER (t), copy_tree_body_r, id, NULL);
  	}
  
-       if ((TREE_CODE (t) == VAR_DECL
- 	   || TREE_CODE (t) == RESULT_DECL
- 	   || TREE_CODE (t) == PARM_DECL)
- 	  && id->src_fn && DECL_STRUCT_FUNCTION (id->src_fn)
- 	  && gimple_referenced_vars (DECL_STRUCT_FUNCTION (id->src_fn))
- 	  /* We don't want to mark as referenced VAR_DECLs that were
- 	     not marked as such in the src function.  */
- 	  && (TREE_CODE (decl) != VAR_DECL
- 	      || referenced_var_lookup (DECL_STRUCT_FUNCTION (id->src_fn),
- 					DECL_UID (decl))))
- 	add_referenced_var (t);
        return t;
      }
  
--- 338,343 ----
*************** remap_gimple_op_r (tree *tp, int *walk_s
*** 844,857 ****
        if (TREE_CODE (*tp) != OMP_CLAUSE)
  	TREE_TYPE (*tp) = remap_type (TREE_TYPE (*tp), id);
  
-       /* Global variables we haven't seen yet need to go into referenced
- 	 vars.  If not referenced from types only.  */
-       if (gimple_referenced_vars (cfun)
- 	  && TREE_CODE (*tp) == VAR_DECL && !is_global_var (*tp)
- 	  && id->remapping_type_depth == 0
- 	  && !processing_debug_stmt)
- 	add_referenced_var (*tp);
- 
        if (TREE_CODE (*tp) == TARGET_EXPR && TREE_OPERAND (*tp, 3))
  	{
  	  /* The copied TARGET_EXPR has never been expanded, even if the
--- 833,838 ----
*************** copy_tree_body_r (tree *tp, int *walk_su
*** 1087,1100 ****
  	 tweak some special cases.  */
        copy_tree_r (tp, walk_subtrees, NULL);
  
-       /* Global variables we haven't seen yet needs to go into referenced
- 	 vars.  If not referenced from types or debug stmts only.  */
-       if (gimple_referenced_vars (cfun)
- 	  && TREE_CODE (*tp) == VAR_DECL && !is_global_var (*tp)
- 	  && id->remapping_type_depth == 0
- 	  && !processing_debug_stmt)
- 	add_referenced_var (*tp);
- 
        /* If EXPR has block defined, map it to newly constructed block.
           When inlining we want EXPRs without block appear in the block
  	 of function call if we are not remapping a type.  */
--- 1068,1073 ----
*************** copy_bb (copy_body_data *id, basic_block
*** 1764,1770 ****
  	      ssa_op_iter i;
  	      tree def;
  
- 	      find_referenced_vars_in (gsi_stmt (copy_gsi));
  	      FOR_EACH_SSA_TREE_OPERAND (def, stmt, i, SSA_OP_DEF)
  		if (TREE_CODE (def) == SSA_NAME)
  		  SSA_NAME_DEF_STMT (def) = stmt;
--- 1737,1742 ----
*************** setup_one_parameter (copy_body_data *id,
*** 2556,2565 ****
       function.  */
    var = copy_decl_to_var (p, id);
  
-   /* We're actually using the newly-created var.  */
-   if (gimple_in_ssa_p (cfun) && TREE_CODE (var) == VAR_DECL)
-     add_referenced_var (var);
- 
    /* Declare this new variable.  */
    DECL_CHAIN (var) = *vars;
    *vars = var;
--- 2528,2533 ----
*************** setup_one_parameter (copy_body_data *id,
*** 2567,2583 ****
    /* Make gimplifier happy about this variable.  */
    DECL_SEEN_IN_BIND_EXPR_P (var) = 1;
  
-   /* We are eventually using the value - make sure all variables
-      referenced therein are properly recorded.  */
-   if (value
-       && gimple_referenced_vars (cfun)
-       && TREE_CODE (value) == ADDR_EXPR)
-     {
-       tree base = get_base_address (TREE_OPERAND (value, 0));
-       if (base && TREE_CODE (base) == VAR_DECL && !is_global_var (base))
- 	add_referenced_var (base);
-     }
- 
    /* If the parameter is never assigned to, has no SSA_NAMEs created,
       we would not need to create a new variable here at all, if it
       weren't for debug info.  Still, we can just use the argument
--- 2535,2540 ----
*************** declare_return_variable (copy_body_data
*** 2883,2891 ****
    gcc_assert (TREE_CODE (TYPE_SIZE_UNIT (callee_type)) == INTEGER_CST);
  
    var = copy_result_decl_to_var (result, id);
-   if (gimple_referenced_vars (cfun))
-     add_referenced_var (var);
- 
    DECL_SEEN_IN_BIND_EXPR_P (var) = 1;
  
    /* Do not have the rest of GCC warn about this variable as it should
--- 2840,2845 ----
*************** declare_return_variable (copy_body_data
*** 2939,2946 ****
        && !is_gimple_val (var))
      {
        tree temp = create_tmp_var (TREE_TYPE (result), "retvalptr");
-       if (gimple_referenced_vars (cfun))
- 	add_referenced_var (temp);
        insert_decl_map (id, result, temp);
        /* When RESULT_DECL is in SSA form, we need to remap and initialize
  	 it's default_def SSA_NAME.  */
--- 2893,2898 ----
*************** copy_decl_for_dup_finish (copy_body_data
*** 4771,4784 ****
         new function.  */
      DECL_CONTEXT (copy) = id->dst_fn;
  
-   if (TREE_CODE (decl) == VAR_DECL
-       /* C++ clones functions during parsing, before
- 	 referenced_vars.  */
-       && gimple_referenced_vars (DECL_STRUCT_FUNCTION (id->src_fn))
-       && referenced_var_lookup (DECL_STRUCT_FUNCTION (id->src_fn),
- 				DECL_UID (decl)))
-     add_referenced_var (copy);
- 
    return copy;
  }
  
--- 4723,4728 ----
*************** copy_arguments_for_versioning (tree orig
*** 4892,4898 ****
  	   as temporary variable later in function, the uses will be
  	   replaced by local variable.  */
  	tree var = copy_decl_to_var (arg, id);
- 	add_referenced_var (var);
  	insert_decl_map (id, arg, var);
          /* Declare this new variable.  */
          DECL_CHAIN (var) = *vars;
--- 4836,4841 ----
*************** tree_function_versioning (tree old_decl,
*** 5173,5184 ****
  	    if (TREE_CODE (op) == VIEW_CONVERT_EXPR)
  	      op = TREE_OPERAND (op, 0);
  
- 	    if (TREE_CODE (op) == ADDR_EXPR)
- 	      {
- 		op = get_base_address (TREE_OPERAND (op, 0));
- 		if (op && TREE_CODE (op) == VAR_DECL && !is_global_var (op))
- 		  add_referenced_var (op);
- 	      }
  	    gcc_assert (TREE_CODE (replace_info->old_tree) == PARM_DECL);
  	    init = setup_one_parameter (&id, replace_info->old_tree,
  	    			        replace_info->new_tree, id.src_fn,
--- 5116,5121 ----
Index: trunk/gcc/tree-pass.h
===================================================================
*** trunk.orig/gcc/tree-pass.h	2012-08-01 15:35:52.000000000 +0200
--- trunk/gcc/tree-pass.h	2012-08-01 15:36:58.934591723 +0200
*************** struct simple_ipa_opt_pass
*** 142,148 ****
  #define PROP_gimple_lcf		(1 << 1)	/* lowered control flow */
  #define PROP_gimple_leh		(1 << 2)	/* lowered eh */
  #define PROP_cfg		(1 << 3)
- #define PROP_referenced_vars	(1 << 4)
  #define PROP_ssa		(1 << 5)
  #define PROP_no_crit_edges      (1 << 6)
  #define PROP_rtl		(1 << 7)
--- 142,147 ----
*************** extern struct gimple_opt_pass pass_lower
*** 267,273 ****
  extern struct gimple_opt_pass pass_lower_resx;
  extern struct gimple_opt_pass pass_build_cfg;
  extern struct gimple_opt_pass pass_early_tree_profile;
- extern struct gimple_opt_pass pass_referenced_vars;
  extern struct gimple_opt_pass pass_cleanup_eh;
  extern struct gimple_opt_pass pass_sra;
  extern struct gimple_opt_pass pass_sra_early;
--- 266,271 ----
Index: trunk/gcc/tree-profile.c
===================================================================
*** trunk.orig/gcc/tree-profile.c	2012-08-01 15:35:52.000000000 +0200
--- trunk/gcc/tree-profile.c	2012-08-01 15:36:58.935591723 +0200
*************** gimple_gen_edge_profiler (int edgeno, ed
*** 220,226 ****
    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));
-   find_referenced_vars_in (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));
--- 220,225 ----
*************** gimple_gen_interval_profiler (histogram_
*** 267,273 ****
    val = prepare_instrumented_value (&gsi, value);
    call = gimple_build_call (tree_interval_profiler_fn, 4,
  			    ref_ptr, val, start, steps);
-   find_referenced_vars_in (call);
    gsi_insert_before (&gsi, call, GSI_NEW_STMT);
  }
  
--- 266,271 ----
*************** gimple_gen_pow2_profiler (histogram_valu
*** 288,294 ****
  				      true, NULL_TREE, true, GSI_SAME_STMT);
    val = prepare_instrumented_value (&gsi, value);
    call = gimple_build_call (tree_pow2_profiler_fn, 2, ref_ptr, val);
-   find_referenced_vars_in (call);
    gsi_insert_before (&gsi, call, GSI_NEW_STMT);
  }
  
--- 286,291 ----
*************** gimple_gen_one_value_profiler (histogram
*** 309,315 ****
  				      true, NULL_TREE, true, GSI_SAME_STMT);
    val = prepare_instrumented_value (&gsi, value);
    call = gimple_build_call (tree_one_value_profiler_fn, 2, ref_ptr, val);
-   find_referenced_vars_in (call);
    gsi_insert_before (&gsi, call, GSI_NEW_STMT);
  }
  
--- 306,311 ----
*************** gimple_gen_ic_profiler (histogram_value
*** 341,350 ****
  
    tmp1 = create_tmp_reg (ptr_void, "PROF");
    stmt1 = gimple_build_assign (ic_gcov_type_ptr_var, ref_ptr);
-   find_referenced_vars_in (stmt1);
    stmt2 = gimple_build_assign (tmp1, unshare_expr (value->hvalue.value));
    gimple_assign_set_lhs (stmt2, make_ssa_name (tmp1, stmt2));
-   find_referenced_vars_in (stmt2);
    stmt3 = gimple_build_assign (ic_void_ptr_var, gimple_assign_lhs (stmt2));
  
    gsi_insert_before (&gsi, stmt1, GSI_SAME_STMT);
--- 337,344 ----
*************** gimple_gen_average_profiler (histogram_v
*** 439,445 ****
  				      true, GSI_SAME_STMT);
    val = prepare_instrumented_value (&gsi, value);
    call = gimple_build_call (tree_average_profiler_fn, 2, ref_ptr, val);
-   find_referenced_vars_in (call);
    gsi_insert_before (&gsi, call, GSI_NEW_STMT);
  }
  
--- 433,438 ----
*************** gimple_gen_ior_profiler (histogram_value
*** 460,466 ****
  				      true, NULL_TREE, true, GSI_SAME_STMT);
    val = prepare_instrumented_value (&gsi, value);
    call = gimple_build_call (tree_ior_profiler_fn, 2, ref_ptr, val);
-   find_referenced_vars_in (call);
    gsi_insert_before (&gsi, call, GSI_NEW_STMT);
  }
  
--- 453,458 ----
Index: trunk/gcc/tree-ssa-live.c
===================================================================
*** trunk.orig/gcc/tree-ssa-live.c	2012-08-01 15:36:56.000000000 +0200
--- trunk/gcc/tree-ssa-live.c	2012-08-01 15:36:58.935591723 +0200
*************** void
*** 692,699 ****
  remove_unused_locals (void)
  {
    basic_block bb;
!   tree var, t;
!   referenced_var_iterator rvi;
    bitmap global_unused_vars = NULL;
    unsigned srcidx, dstidx, num, ix;
    bool have_local_clobbers = false;
--- 692,698 ----
  remove_unused_locals (void)
  {
    basic_block bb;
!   tree var;
    bitmap global_unused_vars = NULL;
    unsigned srcidx, dstidx, num, ix;
    bool have_local_clobbers = false;
*************** remove_unused_locals (void)
*** 828,834 ****
  	    }
  	  else if (!is_used_p (var))
  	    {
- 	      remove_referenced_var (var);
  	      if (cfun->nonlocal_goto_save_area
  		  && TREE_OPERAND (cfun->nonlocal_goto_save_area, 0) == var)
  		cfun->nonlocal_goto_save_area = NULL;
--- 827,832 ----
*************** remove_unused_locals (void)
*** 847,860 ****
    if (dstidx != num)
      VEC_truncate (tree, cfun->local_decls, dstidx);
  
-   /* ???  We end up with decls in referenced-vars that are not in
-      local-decls.  */
-   FOR_EACH_REFERENCED_VAR (cfun, t, rvi)
-     if (TREE_CODE (t) == VAR_DECL
- 	&& !VAR_DECL_IS_VIRTUAL_OPERAND (t)
- 	&& !is_used_p (t))
-       remove_referenced_var (t);
- 
    remove_unused_scope_block_p (DECL_INITIAL (current_function_decl),
  			       global_unused_vars);
  
--- 845,850 ----
Index: trunk/gcc/tree-cfg.c
===================================================================
*** trunk.orig/gcc/tree-cfg.c	2012-08-01 15:35:52.000000000 +0200
--- trunk/gcc/tree-cfg.c	2012-08-01 15:36:58.936591723 +0200
*************** replace_ssa_name (tree name, struct poin
*** 6048,6056 ****
        replace_by_duplicate_decl (&decl, vars_map, to_context);
  
        push_cfun (DECL_STRUCT_FUNCTION (to_context));
-       if (gimple_in_ssa_p (cfun))
- 	add_referenced_var (decl);
- 
        new_name = make_ssa_name (decl, SSA_NAME_DEF_STMT (name));
        if (SSA_NAME_IS_DEFAULT_DEF (name))
  	set_default_def (decl, new_name);
--- 6048,6053 ----
*************** move_stmt_op (tree *tp, int *walk_subtre
*** 6121,6132 ****
  	  if ((TREE_CODE (t) == VAR_DECL
  	       && !is_global_var (t))
  	      || TREE_CODE (t) == CONST_DECL)
! 	    {
! 	      struct function *to_fn = DECL_STRUCT_FUNCTION (p->to_context);
! 	      replace_by_duplicate_decl (tp, p->vars_map, p->to_context);
! 	      if (gimple_referenced_vars (to_fn))
! 		add_referenced_var_1 (*tp, to_fn);
! 	    }
  	}
        *walk_subtrees = 0;
      }
--- 6118,6124 ----
  	  if ((TREE_CODE (t) == VAR_DECL
  	       && !is_global_var (t))
  	      || TREE_CODE (t) == CONST_DECL)
! 	    replace_by_duplicate_decl (tp, p->vars_map, p->to_context);
  	}
        *walk_subtrees = 0;
      }
Index: trunk/gcc/tree-ssa-operands.c
===================================================================
*** trunk.orig/gcc/tree-ssa-operands.c	2012-08-01 15:35:52.000000000 +0200
--- trunk/gcc/tree-ssa-operands.c	2012-08-01 15:36:58.936591723 +0200
*************** create_vop_var (struct function *fn)
*** 177,183 ****
    TREE_ADDRESSABLE (global_var) = 0;
    VAR_DECL_IS_VIRTUAL_OPERAND (global_var) = 1;
  
-   add_referenced_var_1 (global_var, fn);
    fn->gimple_df->vop = global_var;
  }
  
--- 177,182 ----
Index: trunk/gcc/gimple-low.c
===================================================================
*** trunk.orig/gcc/gimple-low.c	2012-08-01 15:35:52.000000000 +0200
--- trunk/gcc/gimple-low.c	2012-08-01 15:36:58.936591723 +0200
*************** record_vars_into (tree vars, tree fn)
*** 1009,1016 ****
  
        /* Record the variable.  */
        add_local_decl (cfun, var);
-       if (gimple_referenced_vars (cfun))
- 	add_referenced_var (var);
      }
  
    if (fn != current_function_decl)
--- 1009,1014 ----
Index: trunk/gcc/gimplify.c
===================================================================
*** trunk.orig/gcc/gimplify.c	2012-08-01 15:35:52.000000000 +0200
--- trunk/gcc/gimplify.c	2012-08-01 15:36:58.937591723 +0200
*************** void
*** 8363,8369 ****
  gimple_regimplify_operands (gimple stmt, gimple_stmt_iterator *gsi_p)
  {
    size_t i, num_ops;
!   tree orig_lhs = NULL_TREE, lhs, t;
    gimple_seq pre = NULL;
    gimple post_stmt = NULL;
    struct gimplify_ctx gctx;
--- 8363,8369 ----
  gimple_regimplify_operands (gimple stmt, gimple_stmt_iterator *gsi_p)
  {
    size_t i, num_ops;
!   tree orig_lhs = NULL_TREE, lhs;
    gimple_seq pre = NULL;
    gimple post_stmt = NULL;
    struct gimplify_ctx gctx;
*************** gimple_regimplify_operands (gimple stmt,
*** 8522,8531 ****
        break;
      }
  
-   if (gimple_referenced_vars (cfun))
-     for (t = gimplify_ctxp->temps; t ; t = TREE_CHAIN (t))
-       add_referenced_var (t);
- 
    if (!gimple_seq_empty_p (pre))
      gsi_insert_seq_before (gsi_p, pre, GSI_SAME_STMT);
    if (post_stmt)
--- 8522,8527 ----
*************** tree
*** 8542,8548 ****
  force_gimple_operand_1 (tree expr, gimple_seq *stmts,
  			gimple_predicate gimple_test_f, tree var)
  {
-   tree t;
    enum gimplify_status ret;
    struct gimplify_ctx gctx;
  
--- 8538,8543 ----
*************** force_gimple_operand_1 (tree expr, gimpl
*** 8574,8583 ****
        gcc_assert (ret != GS_ERROR);
      }
  
-   if (gimple_referenced_vars (cfun))
-     for (t = gimplify_ctxp->temps; t ; t = DECL_CHAIN (t))
-       add_referenced_var (t);
- 
    pop_gimplify_context (NULL);
  
    return expr;
--- 8569,8574 ----
Index: trunk/gcc/omp-low.c
===================================================================
*** trunk.orig/gcc/omp-low.c	2012-08-01 15:35:52.000000000 +0200
--- trunk/gcc/omp-low.c	2012-08-01 15:36:58.938591723 +0200
*************** expand_omp_for_generic (struct omp_regio
*** 3732,3742 ****
    iend0 = create_tmp_var (fd->iter_type, ".iend0");
    TREE_ADDRESSABLE (istart0) = 1;
    TREE_ADDRESSABLE (iend0) = 1;
-   if (gimple_referenced_vars (cfun))
-     {
-       add_referenced_var (istart0);
-       add_referenced_var (iend0);
-     }
  
    /* See if we need to bias by LLONG_MIN.  */
    if (fd->iter_type == long_long_unsigned_type_node
--- 3732,3737 ----
*************** expand_omp_for_static_chunk (struct omp_
*** 4458,4464 ****
    trip_var = create_tmp_reg (itype, ".trip");
    if (gimple_in_ssa_p (cfun))
      {
-       add_referenced_var (trip_var);
        trip_init = make_ssa_name (trip_var, NULL);
        trip_main = make_ssa_name (trip_var, NULL);
        trip_back = make_ssa_name (trip_var, NULL);
--- 4453,4458 ----
*************** expand_omp_atomic_pipeline (basic_block
*** 5305,5315 ****
        gsi_insert_before (&si, stmt, GSI_SAME_STMT);
        loadedi = create_tmp_var (itype, NULL);
        if (gimple_in_ssa_p (cfun))
! 	{
! 	  add_referenced_var (iaddr);
! 	  add_referenced_var (loadedi);
! 	  loadedi = make_ssa_name (loadedi, NULL);
! 	}
      }
    else
      {
--- 5299,5305 ----
        gsi_insert_before (&si, stmt, GSI_SAME_STMT);
        loadedi = create_tmp_var (itype, NULL);
        if (gimple_in_ssa_p (cfun))
! 	loadedi = make_ssa_name (loadedi, NULL);
      }
    else
      {
*************** expand_omp_atomic_pipeline (basic_block
*** 5386,5393 ****
    else
      {
        old_vali = create_tmp_var (TREE_TYPE (loadedi), NULL);
-       if (gimple_in_ssa_p (cfun))
- 	add_referenced_var (old_vali);
        stmt = gimple_build_assign (old_vali, loadedi);
        gsi_insert_before (&si, stmt, GSI_SAME_STMT);
  
--- 5376,5381 ----
Index: trunk/gcc/graphite-clast-to-gimple.c
===================================================================
*** trunk.orig/gcc/graphite-clast-to-gimple.c	2012-08-01 15:35:52.000000000 +0200
--- trunk/gcc/graphite-clast-to-gimple.c	2012-08-01 15:36:58.938591723 +0200
*************** graphite_create_new_loop (edge entry_edg
*** 949,956 ****
      (entry_edge, lb, stride, ub, ivvar, &iv, &iv_after_increment,
       outer ? outer : entry_edge->src->loop_father);
  
-   add_referenced_var (ivvar);
- 
    mpz_init (low);
    mpz_init (up);
    compute_bounds_for_loop (stmt, low, up);
--- 949,954 ----
*************** translate_clast_assignment (struct clast
*** 1221,1227 ****
    var = create_tmp_var (type, "graphite_var");
    new_name = force_gimple_operand (clast_to_gcc_expression (type, expr, ip),
  				   &stmts, true, var);
-   add_referenced_var (var);
    if (stmts)
      {
        gsi_insert_seq_on_edge (next_e, stmts);
--- 1219,1224 ----
Index: trunk/gcc/graphite-sese-to-poly.c
===================================================================
*** trunk.orig/gcc/graphite-sese-to-poly.c	2012-08-01 15:35:52.000000000 +0200
--- trunk/gcc/graphite-sese-to-poly.c	2012-08-01 15:36:58.939591723 +0200
*************** create_zero_dim_array (tree var, const c
*** 2100,2107 ****
    tree array_type = build_array_type (elt_type, index_type);
    tree base = create_tmp_var (array_type, base_name);
  
-   add_referenced_var (base);
- 
    return build4 (ARRAY_REF, elt_type, base, integer_zero_node, NULL_TREE,
  		 NULL_TREE);
  }
--- 2100,2105 ----
*************** handle_scalar_deps_crossing_scop_limits
*** 2405,2411 ****
        gimple assign = gimple_build_assign (new_name, def);
        gimple_stmt_iterator psi = gsi_after_labels (SESE_EXIT (region)->dest);
  
-       add_referenced_var (var);
        SSA_NAME_DEF_STMT (new_name) = assign;
        update_stmt (assign);
        gsi_insert_before (&psi, assign, GSI_SAME_STMT);
--- 2403,2408 ----
Index: trunk/gcc/ipa-prop.c
===================================================================
*** trunk.orig/gcc/ipa-prop.c	2012-08-01 15:35:52.000000000 +0200
--- trunk/gcc/ipa-prop.c	2012-08-01 15:36:58.939591723 +0200
*************** ipa_modify_formal_parameters (tree fndec
*** 2355,2361 ****
  	  DECL_IGNORED_P (new_parm) = 1;
  	  layout_decl (new_parm, 0);
  
- 	  add_referenced_var (new_parm);
  	  adj->base = parm;
  	  adj->reduction = new_parm;
  
--- 2355,2360 ----
Index: trunk/gcc/ipa-split.c
===================================================================
*** trunk.orig/gcc/ipa-split.c	2012-08-01 15:35:52.000000000 +0200
--- trunk/gcc/ipa-split.c	2012-08-01 15:36:58.939591723 +0200
*************** split_function (struct split_point *spli
*** 1083,1089 ****
        {
  	/* This parm might not have been used up to now, but is going to be
  	   used, hence register it.  */
- 	add_referenced_var (parm);
  	if (is_gimple_reg (parm))
  	  {
  	    arg = gimple_default_def (cfun, parm);
--- 1083,1088 ----
Index: trunk/gcc/matrix-reorg.c
===================================================================
*** trunk.orig/gcc/matrix-reorg.c	2012-08-01 15:35:52.000000000 +0200
--- trunk/gcc/matrix-reorg.c	2012-08-01 15:36:58.940591723 +0200
*************** transform_access_sites (void **slot, voi
*** 1833,1839 ****
  				== MEM_REF);
  		    /* Emit convert statement to convert to type of use.  */
  		    tmp = create_tmp_var (TREE_TYPE (lhs), "new");
- 		    add_referenced_var (tmp);
  		    rhs = gimple_assign_rhs1 (acc_info->stmt);
  		    rhs = fold_convert (TREE_TYPE (tmp),
  					TREE_OPERAND (rhs, 0));
--- 1833,1838 ----
Index: trunk/gcc/trans-mem.c
===================================================================
*** trunk.orig/gcc/trans-mem.c	2012-08-01 15:35:52.000000000 +0200
--- trunk/gcc/trans-mem.c	2012-08-01 15:36:58.940591723 +0200
*************** tm_log_add (basic_block entry_block, tre
*** 1018,1024 ****
  	  && !TREE_ADDRESSABLE (type))
  	{
  	  lp->save_var = create_tmp_reg (TREE_TYPE (lp->addr), "tm_save");
- 	  add_referenced_var (lp->save_var);
  	  lp->stmts = NULL;
  	  lp->entry_block = entry_block;
  	  /* Save addresses separately in dominator order so we don't
--- 1018,1023 ----
*************** ipa_tm_insert_gettmclone_call (struct cg
*** 4455,4461 ****
    gettm_fn = builtin_decl_explicit (safe ? BUILT_IN_TM_GETTMCLONE_SAFE
  				    : BUILT_IN_TM_GETTMCLONE_IRR);
    ret = create_tmp_var (ptr_type_node, NULL);
-   add_referenced_var (ret);
  
    if (!safe)
      transaction_subcode_ior (region, GTMA_MAY_ENTER_IRREVOCABLE);
--- 4454,4459 ----
*************** ipa_tm_insert_gettmclone_call (struct cg
*** 4477,4483 ****
    /* Cast return value from tm_gettmclone* into appropriate function
       pointer.  */
    callfn = create_tmp_var (TREE_TYPE (old_fn), NULL);
-   add_referenced_var (callfn);
    g2 = gimple_build_assign (callfn,
  			    fold_build1 (NOP_EXPR, TREE_TYPE (callfn), ret));
    callfn = make_ssa_name (callfn, g2);
--- 4475,4480 ----
Index: trunk/gcc/tree-complex.c
===================================================================
*** trunk.orig/gcc/tree-complex.c	2012-08-01 15:36:56.000000000 +0200
--- trunk/gcc/tree-complex.c	2012-08-01 15:36:58.941591723 +0200
*************** create_one_component_var (tree type, tre
*** 422,428 ****
  			  const char *suffix, enum tree_code code)
  {
    tree r = create_tmp_var (type, prefix);
-   add_referenced_var (r);
  
    DECL_SOURCE_LOCATION (r) = DECL_SOURCE_LOCATION (orig);
    DECL_ARTIFICIAL (r) = 1;
--- 422,427 ----
Index: trunk/gcc/tree-if-conv.c
===================================================================
*** trunk.orig/gcc/tree-if-conv.c	2012-08-01 15:35:52.000000000 +0200
--- trunk/gcc/tree-if-conv.c	2012-08-01 15:36:58.941591723 +0200
*************** ifc_temp_var (tree type, tree expr, gimp
*** 227,233 ****
  
    /* Create new temporary variable.  */
    var = create_tmp_var (type, name);
-   add_referenced_var (var);
  
    /* Build new statement to assign EXPR to new variable.  */
    stmt = gimple_build_assign (var, expr);
--- 227,232 ----
Index: trunk/gcc/tree-parloops.c
===================================================================
*** trunk.orig/gcc/tree-parloops.c	2012-08-01 15:35:52.000000000 +0200
--- trunk/gcc/tree-parloops.c	2012-08-01 15:36:58.941591723 +0200
*************** take_address_of (tree obj, tree type, ed
*** 482,488 ****
        bvar = create_tmp_var (TREE_TYPE (addr),
  			     get_name (TREE_OPERAND
  				         (TREE_OPERAND (*var_p, 0), 0)));
-       add_referenced_var (bvar);
        stmt = gimple_build_assign (bvar, addr);
        name = make_ssa_name (bvar, stmt);
        gimple_assign_set_lhs (stmt, name);
--- 482,487 ----
*************** initialize_reductions (void **slot, void
*** 540,546 ****
    /* Create a new variable to initialize the reduction.  */
    type = TREE_TYPE (PHI_RESULT (reduc->reduc_phi));
    bvar = create_tmp_var (type, "reduction");
-   add_referenced_var (bvar);
  
    c = build_omp_clause (gimple_location (reduc->reduc_stmt),
  			OMP_CLAUSE_REDUCTION);
--- 539,544 ----
*************** separate_decls_in_region_name (tree name
*** 805,811 ****
      {
        var_copy = create_tmp_var (TREE_TYPE (var), get_name (var));
        DECL_GIMPLE_REG_P (var_copy) = DECL_GIMPLE_REG_P (var);
-       add_referenced_var (var_copy);
        nielt = XNEW (struct int_tree_map);
        nielt->uid = uid;
        nielt->to = var_copy;
--- 803,808 ----
*************** create_call_for_reduction_1 (void **slot
*** 1066,1072 ****
    new_bb = e->dest;
  
    tmp_load = create_tmp_var (TREE_TYPE (TREE_TYPE (addr)), NULL);
-   add_referenced_var (tmp_load);
    tmp_load = make_ssa_name (tmp_load, NULL);
    load = gimple_build_omp_atomic_load (tmp_load, addr);
    SSA_NAME_DEF_STMT (tmp_load) = load;
--- 1063,1068 ----
*************** separate_decls_in_region (edge entry, ed
*** 1352,1360 ****
  
        /* Create the loads and stores.  */
        *arg_struct = create_tmp_var (type, ".paral_data_store");
-       add_referenced_var (*arg_struct);
        nvar = create_tmp_var (build_pointer_type (type), ".paral_data_load");
-       add_referenced_var (nvar);
        *new_arg_struct = make_ssa_name (nvar, NULL);
  
        ld_st_data->store = *arg_struct;
--- 1348,1354 ----
Index: trunk/gcc/tree-predcom.c
===================================================================
*** trunk.orig/gcc/tree-predcom.c	2012-08-01 15:35:52.000000000 +0200
--- trunk/gcc/tree-predcom.c	2012-08-01 15:36:58.942591723 +0200
*************** predcom_tmp_var (tree ref, unsigned i, b
*** 1452,1459 ****
    /* We never access the components of the temporary variable in predictive
       commoning.  */
    tree var = create_tmp_reg (type, get_lsm_tmp_name (ref, i));
- 
-   add_referenced_var (var);
    bitmap_set_bit (tmp_vars, DECL_UID (var));
    return var;
  }
--- 1452,1457 ----
*************** reassociate_to_the_same_stmt (tree name1
*** 2193,2204 ****
    /* Insert the new statement combining NAME1 and NAME2 before S1, and
       combine it with the rhs of S1.  */
    var = create_tmp_reg (type, "predreastmp");
-   add_referenced_var (var);
    new_name = make_ssa_name (var, NULL);
    new_stmt = gimple_build_assign_with_ops (code, new_name, name1, name2);
  
    var = create_tmp_reg (type, "predreastmp");
-   add_referenced_var (var);
    tmp_name = make_ssa_name (var, NULL);
  
    /* Rhs of S1 may now be either a binary expression with operation
--- 2191,2200 ----
Index: trunk/gcc/tree-sra.c
===================================================================
*** trunk.orig/gcc/tree-sra.c	2012-08-01 15:36:57.000000000 +0200
--- trunk/gcc/tree-sra.c	2012-08-01 15:36:58.942591723 +0200
*************** build_ref_for_offset (location_t loc, tr
*** 1449,1455 ****
  
        gcc_checking_assert (gsi);
        tmp = create_tmp_reg (build_pointer_type (TREE_TYPE (prev_base)), NULL);
-       add_referenced_var (tmp);
        tmp = make_ssa_name (tmp, NULL);
        addr = build_fold_addr_expr (unshare_expr (prev_base));
        STRIP_USELESS_TYPE_CONVERSION (addr);
--- 1449,1454 ----
*************** create_access_replacement (struct access
*** 1851,1858 ****
    tree repl;
  
    repl = create_tmp_var (access->type, "SR");
-   add_referenced_var (repl);
- 
    if (TREE_CODE (access->type) == COMPLEX_TYPE
        || TREE_CODE (access->type) == VECTOR_TYPE)
      {
--- 1850,1855 ----
*************** get_replaced_param_substitute (struct ip
*** 4183,4189 ****
        DECL_NAME (repl) = get_identifier (pretty_name);
        obstack_free (&name_obstack, pretty_name);
  
-       add_referenced_var (repl);
        adj->new_ssa_base = repl;
      }
    else
--- 4180,4185 ----
*************** sra_ipa_reset_debug_stmts (ipa_parm_adju
*** 4567,4573 ****
  	  SET_DECL_RTL (copy, 0);
  	  TREE_USED (copy) = 1;
  	  DECL_CONTEXT (copy) = current_function_decl;
- 	  add_referenced_var (copy);
  	  add_local_decl (cfun, copy);
  	  DECL_CHAIN (copy) =
  	    BLOCK_VARS (DECL_INITIAL (current_function_decl));
--- 4563,4568 ----
Index: trunk/gcc/tree-ssa-loop-im.c
===================================================================
*** trunk.orig/gcc/tree-ssa-loop-im.c	2012-08-01 15:35:52.000000000 +0200
--- trunk/gcc/tree-ssa-loop-im.c	2012-08-01 15:36:58.943591723 +0200
*************** rewrite_reciprocal (gimple_stmt_iterator
*** 942,950 ****
    lhs = gimple_assign_lhs (stmt);
    type = TREE_TYPE (lhs);
  
!   var = create_tmp_var (type, "reciptmp");
!   add_referenced_var (var);
!   DECL_GIMPLE_REG_P (var) = 1;
  
    real_one = build_one_cst (type);
  
--- 942,948 ----
    lhs = gimple_assign_lhs (stmt);
    type = TREE_TYPE (lhs);
  
!   var = create_tmp_reg (type, "reciptmp");
  
    real_one = build_one_cst (type);
  
*************** rewrite_bittest (gimple_stmt_iterator *b
*** 1024,1030 ****
  
        /* 1 << B */
        var = create_tmp_var (TREE_TYPE (a), "shifttmp");
-       add_referenced_var (var);
        t = fold_build2 (LSHIFT_EXPR, TREE_TYPE (a),
  		       build_int_cst (TREE_TYPE (a), 1), b);
        stmt1 = gimple_build_assign (var, t);
--- 1022,1027 ----
Index: trunk/gcc/tree-ssa-loop-ivopts.c
===================================================================
*** trunk.orig/gcc/tree-ssa-loop-ivopts.c	2012-08-01 15:35:52.000000000 +0200
--- trunk/gcc/tree-ssa-loop-ivopts.c	2012-08-01 15:36:58.943591723 +0200
*************** create_new_iv (struct ivopts_data *data,
*** 6032,6038 ****
      }
  
    gimple_add_tmp_var (cand->var_before);
-   add_referenced_var (cand->var_before);
  
    base = unshare_expr (cand->iv->base);
  
--- 6032,6037 ----
Index: trunk/gcc/tree-ssa-loop-manip.c
===================================================================
*** trunk.orig/gcc/tree-ssa-loop-manip.c	2012-08-01 15:35:52.000000000 +0200
--- trunk/gcc/tree-ssa-loop-manip.c	2012-08-01 15:36:58.944591723 +0200
*************** create_iv (tree base, tree step, tree va
*** 56,65 ****
    edge pe = loop_preheader_edge (loop);
  
    if (!var)
!     {
!       var = create_tmp_var (TREE_TYPE (base), "ivtmp");
!       add_referenced_var (var);
!     }
  
    vb = make_ssa_name (var, NULL);
    if (var_before)
--- 56,62 ----
    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)
*************** tree_transform_and_unroll_loop (struct l
*** 1009,1023 ****
  					     TREE_TYPE (next)))
  	var = SSA_NAME_VAR (init);
        else if (useless_type_conversion_p (TREE_TYPE (next), TREE_TYPE (init)))
! 	{
! 	  var = create_tmp_var (TREE_TYPE (next), "unrinittmp");
! 	  add_referenced_var (var);
! 	}
        else
! 	{
! 	  var = create_tmp_var (TREE_TYPE (init), "unrinittmp");
! 	  add_referenced_var (var);
! 	}
  
        new_init = make_ssa_name (var, NULL);
        phi_rest = create_phi_node (new_init, rest);
--- 1006,1014 ----
  					     TREE_TYPE (next)))
  	var = SSA_NAME_VAR (init);
        else if (useless_type_conversion_p (TREE_TYPE (next), TREE_TYPE (init)))
! 	var = create_tmp_var (TREE_TYPE (next), "unrinittmp");
        else
! 	var = create_tmp_var (TREE_TYPE (init), "unrinittmp");
  
        new_init = make_ssa_name (var, NULL);
        phi_rest = create_phi_node (new_init, rest);
Index: trunk/gcc/tree-ssa-math-opts.c
===================================================================
*** trunk.orig/gcc/tree-ssa-math-opts.c	2012-08-01 15:35:52.000000000 +0200
--- trunk/gcc/tree-ssa-math-opts.c	2012-08-01 15:36:58.944591723 +0200
*************** powi_as_mults (gimple_stmt_iterator *gsi
*** 989,996 ****
    cache[1] = arg0;
  
    target = create_tmp_reg (type, "powmult");
-   add_referenced_var (target);
- 
    result = powi_as_mults_1 (gsi, loc, type, (n < 0) ? -n : n, cache, target);
  
    if (n >= 0)
--- 989,994 ----
*************** build_and_insert_call (gimple_stmt_itera
*** 1041,1050 ****
    tree ssa_target;
  
    if (!*var)
!     {
!       *var = create_tmp_reg (TREE_TYPE (arg), "powroot");
!       add_referenced_var (*var);
!     }
  
    call_stmt = gimple_build_call (fn, 1, arg);
    ssa_target = make_ssa_name (*var, NULL);
--- 1039,1045 ----
    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_expand_builtin_cabs (gimple_stmt_
*** 1354,1361 ****
      return NULL_TREE;
  
    target = create_tmp_reg (type, "cabs");
-   add_referenced_var (target);
- 
    real_part = build_and_insert_ref (gsi, loc, type, target,
  				    REALPART_EXPR, arg);
    addend1 = build_and_insert_binop (gsi, loc, target, MULT_EXPR,
--- 1349,1354 ----
*************** execute_optimize_bswap (void)
*** 1900,1906 ****
  	      gimple convert_stmt;
  
  	      bswap_tmp = create_tmp_var (bswap_type, "bswapsrc");
- 	      add_referenced_var (bswap_tmp);
  	      bswap_tmp = make_ssa_name (bswap_tmp, NULL);
  
  	      convert_stmt = gimple_build_assign_with_ops (
--- 1893,1898 ----
*************** execute_optimize_bswap (void)
*** 1918,1924 ****
  	      gimple convert_stmt;
  
  	      bswap_tmp = create_tmp_var (bswap_type, "bswapdst");
- 	      add_referenced_var (bswap_tmp);
  	      bswap_tmp = make_ssa_name (bswap_tmp, NULL);
  	      convert_stmt = gimple_build_assign_with_ops (
  		               CONVERT_EXPR, gimple_assign_lhs (stmt), bswap_tmp, NULL);
--- 1910,1915 ----
Index: trunk/gcc/tree-ssa-phiopt.c
===================================================================
*** trunk.orig/gcc/tree-ssa-phiopt.c	2012-08-01 15:35:52.000000000 +0200
--- trunk/gcc/tree-ssa-phiopt.c	2012-08-01 15:36:58.944591723 +0200
*************** conditional_replacement (basic_block con
*** 691,697 ****
        source_location locus_0, locus_1;
  
        new_var2 = create_tmp_var (TREE_TYPE (result), NULL);
-       add_referenced_var (new_var2);
        new_stmt = gimple_build_assign_with_ops (CONVERT_EXPR, new_var2,
  					       new_var, NULL);
        new_var2 = make_ssa_name (new_var2, new_stmt);
--- 691,696 ----
*************** abs_replacement (basic_block cond_bb, ba
*** 1215,1221 ****
    if (negate)
      {
        tree tmp = create_tmp_var (TREE_TYPE (result), NULL);
-       add_referenced_var (tmp);
        lhs = make_ssa_name (tmp, NULL);
      }
    else
--- 1214,1219 ----
*************** cond_store_replacement (basic_block midd
*** 1482,1488 ****
          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");
-   add_referenced_var (condstoretemp);
  
    /* 3) Insert a load from the memory of the store to the temporary
          on the edge which did not contain the store.  */
--- 1480,1485 ----
*************** cond_if_else_store_replacement_1 (basic_
*** 1567,1573 ****
  	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");
-   add_referenced_var (condstoretemp);
  
    /* 3) Create a PHI node at the join block, with one argument
  	holding the old RHS, and the other holding the temporary
--- 1564,1569 ----
Index: trunk/gcc/tree-ssa-phiprop.c
===================================================================
*** trunk.orig/gcc/tree-ssa-phiprop.c	2012-08-01 15:35:52.000000000 +0200
--- trunk/gcc/tree-ssa-phiprop.c	2012-08-01 15:36:58.944591723 +0200
*************** phiprop_insert_phi (basic_block bb, gimp
*** 196,202 ****
  						  old_arg,
  						  TREE_OPERAND (rhs, 1)));
  	  gcc_assert (is_gimple_reg (new_var));
- 	  add_referenced_var (new_var);
  	  new_var = make_ssa_name (new_var, tmp);
  	  gimple_assign_set_lhs (tmp, new_var);
  	  gimple_set_location (tmp, locus);
--- 196,201 ----
Index: trunk/gcc/tree-ssa-pre.c
===================================================================
*** trunk.orig/gcc/tree-ssa-pre.c	2012-08-01 15:35:52.000000000 +0200
--- trunk/gcc/tree-ssa-pre.c	2012-08-01 15:36:58.945591723 +0200
*************** get_representative_for (const pre_expr e
*** 1411,1420 ****
    /* 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");
!       add_referenced_var (pretemp);
!     }
  
    name = make_ssa_name (pretemp, gimple_build_nop ());
    VN_INFO_GET (name)->value_id = value_id;
--- 1411,1417 ----
    /* 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;
*************** create_expression_by_pieces (basic_block
*** 3110,3116 ****
      pretemp = create_tmp_reg (exprtype, "pretmp");
  
    temp = pretemp;
-   add_referenced_var (temp);
  
    newstmt = gimple_build_assign (temp, folded);
    name = make_ssa_name (temp, newstmt);
--- 3107,3112 ----
*************** insert_into_preds_of_block (basic_block
*** 3369,3375 ****
      prephitemp = create_tmp_var (type, "prephitmp");
  
    temp = prephitemp;
-   add_referenced_var (temp);
  
    if (TREE_CODE (type) == COMPLEX_TYPE
        || TREE_CODE (type) == VECTOR_TYPE)
--- 3365,3370 ----
Index: trunk/gcc/tree-ssa-propagate.c
===================================================================
*** trunk.orig/gcc/tree-ssa-propagate.c	2012-08-01 15:35:52.000000000 +0200
--- trunk/gcc/tree-ssa-propagate.c	2012-08-01 15:36:58.945591723 +0200
*************** update_call_from_tree (gimple_stmt_itera
*** 793,799 ****
            STRIP_USELESS_TYPE_CONVERSION (expr);
            lhs = create_tmp_var (TREE_TYPE (expr), NULL);
            new_stmt = gimple_build_assign (lhs, expr);
-           add_referenced_var (lhs);
  	  if (gimple_in_ssa_p (cfun))
  	    lhs = make_ssa_name (lhs, new_stmt);
            gimple_assign_set_lhs (new_stmt, lhs);
--- 793,798 ----
Index: trunk/gcc/tree-ssa-reassoc.c
===================================================================
*** trunk.orig/gcc/tree-ssa-reassoc.c	2012-08-01 15:35:52.000000000 +0200
--- trunk/gcc/tree-ssa-reassoc.c	2012-08-01 15:36:58.946591723 +0200
*************** undistribute_ops_list (enum tree_code op
*** 1433,1439 ****
  	      print_generic_expr (dump_file, oe1->op, 0);
  	    }
  	  tmpvar = create_tmp_reg (TREE_TYPE (oe1->op), NULL);
- 	  add_referenced_var (tmpvar);
  	  zero_one_operation (&oe1->op, c->oecode, c->op);
  	  EXECUTE_IF_SET_IN_SBITMAP (candidates2, first+1, i, sbi0)
  	    {
--- 1433,1438 ----
*************** eliminate_redundant_comparison (enum tre
*** 1598,1604 ****
  	  tree newop2;
  	  gcc_assert (COMPARISON_CLASS_P (t));
  	  tmpvar = create_tmp_var (TREE_TYPE (t), NULL);
- 	  add_referenced_var (tmpvar);
  	  extract_ops_from_tree (t, &subcode, &newop1, &newop2);
  	  STRIP_USELESS_TYPE_CONVERSION (newop1);
  	  STRIP_USELESS_TYPE_CONVERSION (newop2);
--- 1597,1602 ----
*************** rewrite_expr_tree_parallel (gimple stmt,
*** 2454,2460 ****
      stmts[i] = SSA_NAME_DEF_STMT (gimple_assign_rhs1 (stmts[i+1]));
  
    lhs_var = create_tmp_reg (TREE_TYPE (last_rhs1), NULL);
-   add_referenced_var (lhs_var);
  
    for (i = 0; i < stmt_num; i++)
      {
--- 2452,2457 ----
*************** static tree
*** 3086,3095 ****
  get_reassoc_pow_ssa_name (tree *target, tree type)
  {
    if (!*target || !types_compatible_p (type, TREE_TYPE (*target)))
!     {
!       *target = create_tmp_reg (type, "reassocpow");
!       add_referenced_var (*target);
!     }
  
    return make_ssa_name (*target, NULL);
  }
--- 3083,3089 ----
  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);
  }
Index: trunk/gcc/tree-ssa-strlen.c
===================================================================
*** trunk.orig/gcc/tree-ssa-strlen.c	2012-08-01 15:35:52.000000000 +0200
--- trunk/gcc/tree-ssa-strlen.c	2012-08-01 15:36:58.946591723 +0200
*************** get_string_length (strinfo si)
*** 416,422 ****
  	  fn = builtin_decl_implicit (BUILT_IN_STRLEN);
  	  gcc_assert (lhs == NULL_TREE);
  	  lhs_var = create_tmp_var (TREE_TYPE (TREE_TYPE (fn)), NULL);
- 	  add_referenced_var (lhs_var);
  	  tem = unshare_expr (gimple_call_arg (stmt, 0));
  	  lenstmt = gimple_build_call (fn, 1, tem);
  	  lhs = make_ssa_name (lhs_var, lenstmt);
--- 416,421 ----
*************** get_string_length (strinfo si)
*** 425,431 ****
  	  gsi_insert_before (&gsi, lenstmt, GSI_SAME_STMT);
  	  lhs_var = create_tmp_var (TREE_TYPE (gimple_call_arg (stmt, 0)),
  				    NULL);
- 	  add_referenced_var (lhs_var);
  	  tem = gimple_call_arg (stmt, 0);
            if (!ptrofftype_p (TREE_TYPE (lhs)))
              {
--- 424,429 ----
*************** get_string_length (strinfo si)
*** 455,461 ****
  	    }
  	  gimple_call_set_fndecl (stmt, fn);
  	  lhs_var = create_tmp_var (TREE_TYPE (TREE_TYPE (fn)), NULL);
- 	  add_referenced_var (lhs_var);
  	  lhs = make_ssa_name (lhs_var, stmt);
  	  gimple_call_set_lhs (stmt, lhs);
  	  update_stmt (stmt);
--- 453,458 ----
Index: trunk/gcc/tree-switch-conversion.c
===================================================================
*** trunk.orig/gcc/tree-switch-conversion.c	2012-08-01 15:35:52.000000000 +0200
--- trunk/gcc/tree-switch-conversion.c	2012-08-01 15:36:58.946591723 +0200
*************** emit_case_bit_tests (gimple swtch, tree
*** 425,431 ****
  
    /* csui = (1 << (word_mode) idx) */
    tmp = create_tmp_var (word_type_node, "csui");
-   add_referenced_var (tmp);
    csui = make_ssa_name (tmp, NULL);
    tmp = fold_build2 (LSHIFT_EXPR, word_type_node, word_mode_one,
  		     fold_convert (word_type_node, idx));
--- 425,430 ----
*************** build_arrays (gimple swtch, struct switc
*** 1109,1115 ****
  
    arr_index_type = build_index_type (info->range_size);
    tmp = create_tmp_var (utype, "csui");
-   add_referenced_var (tmp);
    tidx = make_ssa_name (tmp, NULL);
    sub = fold_build2_loc (loc, MINUS_EXPR, utype,
  			 fold_convert_loc (loc, utype, info->index_expr),
--- 1108,1113 ----
Index: trunk/gcc/tree-tailcall.c
===================================================================
*** trunk.orig/gcc/tree-tailcall.c	2012-08-01 15:36:56.000000000 +0200
--- trunk/gcc/tree-tailcall.c	2012-08-01 15:36:58.947591723 +0200
*************** adjust_return_value_with_ops (enum tree_
*** 613,620 ****
    gimple stmt;
    tree result;
  
-   add_referenced_var (tmp);
- 
    if (types_compatible_p (TREE_TYPE (acc), TREE_TYPE (op1)))
      stmt = gimple_build_assign_with_ops (code, tmp, acc, op1);
    else
--- 613,618 ----
*************** create_tailcall_accumulator (const char
*** 912,918 ****
    tree tmp = create_tmp_reg (ret_type, label);
    gimple phi;
  
-   add_referenced_var (tmp);
    phi = create_phi_node (tmp, bb);
    /* RET_TYPE can be a float when -ffast-maths is enabled.  */
    add_phi_arg (phi, fold_convert (ret_type, init), single_pred_edge (bb),
--- 910,915 ----
Index: trunk/gcc/tree-vect-data-refs.c
===================================================================
*** trunk.orig/gcc/tree-vect-data-refs.c	2012-08-01 15:35:52.000000000 +0200
--- trunk/gcc/tree-vect-data-refs.c	2012-08-01 15:36:58.947591723 +0200
*************** vect_get_new_vect_var (tree type, enum v
*** 3432,3438 ****
      }
    else
      new_vect_var = create_tmp_reg (type, prefix);
-   add_referenced_var (new_vect_var);
  
    return new_vect_var;
  }
--- 3432,3437 ----
*************** vect_create_addr_base_for_vector_ref (gi
*** 3512,3518 ****
      }
  
    data_ref_base_var = create_tmp_var (TREE_TYPE (data_ref_base), "batmp");
-   add_referenced_var (data_ref_base_var);
    data_ref_base = force_gimple_operand (data_ref_base, &seq, true,
  					data_ref_base_var);
    gimple_seq_add_seq (new_stmt_list, seq);
--- 3511,3516 ----
*************** vect_create_addr_base_for_vector_ref (gi
*** 3522,3528 ****
  			    fold_convert (sizetype, base_offset),
  			    fold_convert (sizetype, init));
    dest = create_tmp_var (sizetype, "base_off");
-   add_referenced_var (dest);
    base_offset = force_gimple_operand (base_offset, &seq, true, dest);
    gimple_seq_add_seq (new_stmt_list, seq);
  
--- 3520,3525 ----
*************** vect_create_addr_base_for_vector_ref (gi
*** 3530,3536 ****
      {
        tree tmp = create_tmp_var (sizetype, "offset");
  
-       add_referenced_var (tmp);
        offset = fold_build2 (MULT_EXPR, sizetype,
  			    fold_convert (sizetype, offset), step);
        base_offset = fold_build2 (PLUS_EXPR, sizetype,
--- 3527,3532 ----
*************** vect_permute_store_chain (VEC(tree,heap)
*** 4168,4174 ****
  	  /* Create interleaving stmt:
  	     high = VEC_PERM_EXPR <vect1, vect2, {0, nelt, 1, nelt+1, ...}>  */
  	  perm_dest = create_tmp_reg (vectype, "vect_inter_high");
- 	  add_referenced_var (perm_dest);
  	  high = make_ssa_name (perm_dest, NULL);
  	  perm_stmt
  	    = gimple_build_assign_with_ops3 (VEC_PERM_EXPR, high,
--- 4164,4169 ----
*************** vect_permute_store_chain (VEC(tree,heap)
*** 4180,4186 ****
  	     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");
- 	  add_referenced_var (perm_dest);
  	  low = make_ssa_name (perm_dest, NULL);
  	  perm_stmt
  	    = gimple_build_assign_with_ops3 (VEC_PERM_EXPR, low,
--- 4175,4180 ----
*************** vect_permute_load_chain (VEC(tree,heap)
*** 4623,4629 ****
  
  	  /* data_ref = permute_even (first_data_ref, second_data_ref);  */
  	  perm_dest = create_tmp_reg (vectype, "vect_perm_even");
- 	  add_referenced_var (perm_dest);
  
  	  perm_stmt = gimple_build_assign_with_ops3 (VEC_PERM_EXPR, perm_dest,
  						     first_vect, second_vect,
--- 4617,4622 ----
*************** vect_permute_load_chain (VEC(tree,heap)
*** 4637,4643 ****
  
  	  /* data_ref = permute_odd (first_data_ref, second_data_ref);  */
  	  perm_dest = create_tmp_reg (vectype, "vect_perm_odd");
- 	  add_referenced_var (perm_dest);
  
  	  perm_stmt = gimple_build_assign_with_ops3 (VEC_PERM_EXPR, perm_dest,
  						     first_vect, second_vect,
--- 4630,4635 ----
Index: trunk/gcc/tree-vect-generic.c
===================================================================
*** trunk.orig/gcc/tree-vect-generic.c	2012-08-01 15:35:52.000000000 +0200
--- trunk/gcc/tree-vect-generic.c	2012-08-01 15:36:58.947591723 +0200
*************** expand_vector_divmod (gimple_stmt_iterat
*** 668,674 ****
  					 << shifts[i]) - 1);
  	      cst = build_vector (type, vec);
  	      addend = create_tmp_reg (type, NULL);
- 	      add_referenced_var (addend);
  	      addend = make_ssa_name (addend, NULL);
  	      stmt = gimple_build_assign_with_ops3 (VEC_COND_EXPR, addend,
  						    cond, cst, zero);
--- 668,673 ----
Index: trunk/gcc/tree-vect-loop-manip.c
===================================================================
*** trunk.orig/gcc/tree-vect-loop-manip.c	2012-08-01 15:35:52.000000000 +0200
--- trunk/gcc/tree-vect-loop-manip.c	2012-08-01 15:36:58.948591723 +0200
*************** set_prologue_iterations (basic_block bb_
*** 1078,1084 ****
  
    var = create_tmp_var (TREE_TYPE (scalar_loop_iters),
  			"prologue_after_cost_adjust");
-   add_referenced_var (var);
    prologue_after_cost_adjust_name =
      force_gimple_operand (scalar_loop_iters, &stmts, false, var);
  
--- 1078,1083 ----
*************** vect_build_loop_niters (loop_vec_info lo
*** 1497,1503 ****
    tree ni = unshare_expr (LOOP_VINFO_NITERS (loop_vinfo));
  
    var = create_tmp_var (TREE_TYPE (ni), "niters");
-   add_referenced_var (var);
    ni_name = force_gimple_operand (ni, &stmts, false, var);
  
    pe = loop_preheader_edge (loop);
--- 1496,1501 ----
*************** vect_generate_tmps_on_preheader (loop_ve
*** 1564,1570 ****
        if (!is_gimple_val (ni_minus_gap_name))
  	{
  	  var = create_tmp_var (TREE_TYPE (ni), "ni_gap");
-           add_referenced_var (var);
  
            stmts = NULL;
            ni_minus_gap_name = force_gimple_operand (ni_minus_gap_name, &stmts,
--- 1562,1567 ----
*************** vect_generate_tmps_on_preheader (loop_ve
*** 1589,1595 ****
    if (!is_gimple_val (ratio_name))
      {
        var = create_tmp_var (TREE_TYPE (ni), "bnd");
-       add_referenced_var (var);
  
        stmts = NULL;
        ratio_name = force_gimple_operand (ratio_name, &stmts, true, var);
--- 1586,1591 ----
*************** vect_generate_tmps_on_preheader (loop_ve
*** 1610,1616 ****
    if (!is_gimple_val (ratio_mult_vf_name))
      {
        var = create_tmp_var (TREE_TYPE (ni), "ratio_mult_vf");
-       add_referenced_var (var);
  
        stmts = NULL;
        ratio_mult_vf_name = force_gimple_operand (ratio_mult_vf_name, &stmts,
--- 1606,1611 ----
*************** vect_update_ivs_after_vectorizer (loop_v
*** 1835,1841 ****
  			  init_expr, fold_convert (type, off));
  
        var = create_tmp_var (type, "tmp");
-       add_referenced_var (var);
  
        last_gsi = gsi_last_bb (exit_bb);
        ni_name = force_gimple_operand_gsi (&last_gsi, ni, false, var,
--- 1830,1835 ----
*************** vect_gen_niters_for_prolog_loop (loop_ve
*** 2041,2047 ****
      }
  
    var = create_tmp_var (niters_type, "prolog_loop_niters");
-   add_referenced_var (var);
    stmts = NULL;
    iters_name = force_gimple_operand (iters, &stmts, false, var);
  
--- 2035,2040 ----
*************** vect_do_peeling_for_alignment (loop_vec_
*** 2159,2165 ****
        edge pe = loop_preheader_edge (loop);
        tree wide_iters = fold_convert (sizetype, niters_of_prolog_loop);
        tree var = create_tmp_var (sizetype, "prolog_loop_adjusted_niters");
-       add_referenced_var (var);
        wide_prolog_niters = force_gimple_operand (wide_iters, &seq, false,
                                                   var);
        if (seq)
--- 2152,2157 ----
*************** vect_create_cond_for_align_checks (loop_
*** 2257,2263 ****
  
        sprintf (tmp_name, "%s%d", "addr2int", i);
        addr_tmp = create_tmp_reg (int_ptrsize_type, tmp_name);
-       add_referenced_var (addr_tmp);
        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);
--- 2249,2254 ----
*************** vect_create_cond_for_align_checks (loop_
*** 2271,2277 ****
            /* create: or_tmp = or_tmp | addr_tmp */
            sprintf (tmp_name, "%s%d", "orptrs", i);
            or_tmp = create_tmp_reg (int_ptrsize_type, tmp_name);
-           add_referenced_var (or_tmp);
  	  new_or_tmp_name = make_ssa_name (or_tmp, NULL);
  	  or_stmt = gimple_build_assign_with_ops (BIT_IOR_EXPR,
  						  new_or_tmp_name,
--- 2262,2267 ----
*************** vect_create_cond_for_align_checks (loop_
*** 2289,2295 ****
  
    /* create: and_tmp = or_tmp & mask  */
    and_tmp = create_tmp_reg (int_ptrsize_type, "andmask" );
-   add_referenced_var (and_tmp);
    and_tmp_name = make_ssa_name (and_tmp, NULL);
  
    and_stmt = gimple_build_assign_with_ops (BIT_AND_EXPR, and_tmp_name,
--- 2279,2284 ----
Index: trunk/gcc/tree-vect-patterns.c
===================================================================
*** trunk.orig/gcc/tree-vect-patterns.c	2012-08-01 15:35:52.000000000 +0200
--- trunk/gcc/tree-vect-patterns.c	2012-08-01 15:36:58.948591723 +0200
*************** static tree
*** 207,214 ****
  vect_recog_temp_ssa_var (tree type, gimple stmt)
  {
    tree var = create_tmp_reg (type, "patt");
- 
-   add_referenced_var (var);
    var = make_ssa_name (var, stmt);
    return var;
  }
--- 207,212 ----
*************** vect_handle_widen_op_by_const (gimple st
*** 502,508 ****
        /* Create a_T = (NEW_TYPE) a_t;  */
        *oprnd = gimple_assign_rhs1 (def_stmt);
        tmp = create_tmp_reg (new_type, NULL);
-       add_referenced_var (tmp);
        new_oprnd = make_ssa_name (tmp, NULL);
        new_stmt = gimple_build_assign_with_ops (NOP_EXPR, new_oprnd, *oprnd,
  					       NULL_TREE);
--- 500,505 ----
*************** vect_operation_fits_smaller_type (gimple
*** 1107,1113 ****
                /* Create NEW_OPRND = (INTERM_TYPE) OPRND.  */
                oprnd = gimple_assign_rhs1 (def_stmt);
                tmp = create_tmp_reg (interm_type, NULL);
-               add_referenced_var (tmp);
                new_oprnd = make_ssa_name (tmp, NULL);
                new_stmt = gimple_build_assign_with_ops (NOP_EXPR, new_oprnd,
                                                         oprnd, NULL_TREE);
--- 1104,1109 ----
*************** vect_operation_fits_smaller_type (gimple
*** 1128,1134 ****
          {
            /* Create a type conversion HALF_TYPE->INTERM_TYPE.  */
            tmp = create_tmp_reg (interm_type, NULL);
-           add_referenced_var (tmp);
            new_oprnd = make_ssa_name (tmp, NULL);
            new_stmt = gimple_build_assign_with_ops (NOP_EXPR, new_oprnd,
                                                     oprnd, NULL_TREE);
--- 1124,1129 ----
*************** vect_recog_over_widening_pattern (VEC (g
*** 1260,1266 ****
          {
            /* Create NEW_TYPE->USE_TYPE conversion.  */
            tmp = create_tmp_reg (use_type, NULL);
-           add_referenced_var (tmp);
            new_oprnd = make_ssa_name (tmp, NULL);
            pattern_stmt = gimple_build_assign_with_ops (NOP_EXPR, new_oprnd,
                                                         var, NULL_TREE);
--- 1255,1260 ----
Index: trunk/gcc/tree-vect-stmts.c
===================================================================
*** trunk.orig/gcc/tree-vect-stmts.c	2012-08-01 15:35:52.000000000 +0200
--- trunk/gcc/tree-vect-stmts.c	2012-08-01 15:36:58.949591723 +0200
*************** vect_init_vector (gimple stmt, tree val,
*** 1271,1277 ****
  	  else
  	    {
  	      new_var = create_tmp_reg (TREE_TYPE (type), NULL);
- 	      add_referenced_var (new_var);
  	      init_stmt = gimple_build_assign_with_ops (NOP_EXPR,
  							new_var, val,
  							NULL_TREE);
--- 1271,1276 ----
Index: trunk/gcc/testsuite/gcc.dg/torture/pta-callused-1.c
===================================================================
*** trunk.orig/gcc/testsuite/gcc.dg/torture/pta-callused-1.c	2011-12-06 10:39:54.000000000 +0100
--- trunk/gcc/testsuite/gcc.dg/torture/pta-callused-1.c	2012-08-01 15:56:26.341551305 +0200
*************** int main()
*** 21,25 ****
    return 0;
  }
  
! /* { dg-final { scan-tree-dump "p.._., points-to vars: { i j }" "alias" } } */
  /* { dg-final { cleanup-tree-dump "alias" } } */
--- 21,25 ----
    return 0;
  }
  
! /* { dg-final { scan-tree-dump "p.._. = { i j }" "alias" } } */
  /* { dg-final { cleanup-tree-dump "alias" } } */
Index: trunk/gcc/testsuite/gcc.dg/torture/pta-ptrarith-3.c
===================================================================
*** trunk.orig/gcc/testsuite/gcc.dg/torture/pta-ptrarith-3.c	2011-12-06 10:39:54.000000000 +0100
--- trunk/gcc/testsuite/gcc.dg/torture/pta-ptrarith-3.c	2012-08-01 15:57:10.298549784 +0200
*************** int main()
*** 33,37 ****
    return 0;
  }
  
! /* { dg-final { scan-tree-dump "q_., points-to vars: { i j k }" "alias" } } */
  /* { dg-final { cleanup-tree-dump "alias" } } */
--- 33,37 ----
    return 0;
  }
  
! /* { dg-final { scan-tree-dump "q_. = { i j k }" "alias" } } */
  /* { dg-final { cleanup-tree-dump "alias" } } */
Index: trunk/gcc/testsuite/gcc.dg/torture/ssa-pta-fn-1.c
===================================================================
*** trunk.orig/gcc/testsuite/gcc.dg/torture/ssa-pta-fn-1.c	2011-12-06 10:39:54.000000000 +0100
--- trunk/gcc/testsuite/gcc.dg/torture/ssa-pta-fn-1.c	2012-08-01 15:59:25.100545114 +0200
*************** int main()
*** 56,62 ****
    return 0;
  }
  
! /* { dg-final { scan-tree-dump "q_const_., points-to non-local, points-to vars: { i }" "alias" } } */
! /* { dg-final { scan-tree-dump "q_pure_., points-to non-local, points-to escaped, points-to vars: { i }" "alias" } } */
! /* { dg-final { scan-tree-dump "q_normal_., points-to non-local, points-to escaped, points-to vars: { }" "alias" } } */
  /* { dg-final { cleanup-tree-dump "alias" } } */
--- 56,62 ----
    return 0;
  }
  
! /* { dg-final { scan-tree-dump "q_const_. = { NONLOCAL i }" "alias" } } */
! /* { dg-final { scan-tree-dump "q_pure_. = { ESCAPED NONLOCAL i }" "alias" } } */
! /* { dg-final { scan-tree-dump "q_normal_. = { ESCAPED NONLOCAL }" "alias" } } */
  /* { dg-final { cleanup-tree-dump "alias" } } */
Index: trunk/gcc/testsuite/gcc.dg/tree-ssa/alias-19.c
===================================================================
*** trunk.orig/gcc/testsuite/gcc.dg/tree-ssa/alias-19.c	2012-05-23 14:24:58.000000000 +0200
--- trunk/gcc/testsuite/gcc.dg/tree-ssa/alias-19.c	2012-08-01 15:45:34.154573877 +0200
***************
*** 1,5 ****
  /* { dg-do run } */
! /* { dg-options "-O2 -fdump-tree-alias-vops" } */
  
  const static int a;
  
--- 1,5 ----
  /* { dg-do run } */
! /* { dg-options "-O2 -fdump-tree-alias" } */
  
  const static int a;
  
*************** int main()
*** 26,30 ****
  }
  
  /* { dg-final { scan-tree-dump "q_. = { a b }" "alias" } } */
- /* { dg-final { scan-tree-dump "q_., points-to vars: { D..... b }" "alias" } } */
  /* { dg-final { cleanup-tree-dump "alias" } } */
--- 26,29 ----
Index: trunk/gcc/testsuite/gcc.dg/tree-ssa/pta-escape-1.c
===================================================================
*** trunk.orig/gcc/testsuite/gcc.dg/tree-ssa/pta-escape-1.c	2010-10-18 17:44:05.000000000 +0200
--- trunk/gcc/testsuite/gcc.dg/tree-ssa/pta-escape-1.c	2012-08-01 15:47:51.018569146 +0200
*************** int main()
*** 33,37 ****
    return 0;
  }
  
! /* { dg-final { scan-tree-dump "ESCAPED, points-to non-local, points-to NULL, points-to vars: { x }" "alias" } } */
  /* { dg-final { cleanup-tree-dump "alias" } } */
--- 33,37 ----
    return 0;
  }
  
! /* { dg-final { scan-tree-dump "ESCAPED = { NULL ESCAPED NONLOCAL x }" "alias" } } */
  /* { dg-final { cleanup-tree-dump "alias" } } */
Index: trunk/gcc/testsuite/gcc.dg/tree-ssa/pta-escape-2.c
===================================================================
*** trunk.orig/gcc/testsuite/gcc.dg/tree-ssa/pta-escape-2.c	2010-10-18 17:44:05.000000000 +0200
--- trunk/gcc/testsuite/gcc.dg/tree-ssa/pta-escape-2.c	2012-08-01 15:48:11.965568412 +0200
*************** int main()
*** 34,38 ****
    return 0;
  }
  
! /* { dg-final { scan-tree-dump "ESCAPED, points-to non-local, points-to NULL, points-to vars: { x }" "alias" } } */
  /* { dg-final { cleanup-tree-dump "alias" } } */
--- 34,38 ----
    return 0;
  }
  
! /* { dg-final { scan-tree-dump "ESCAPED = { NULL ESCAPED NONLOCAL x }" "alias" } } */
  /* { dg-final { cleanup-tree-dump "alias" } } */
Index: trunk/gcc/testsuite/gcc.dg/tree-ssa/pta-escape-3.c
===================================================================
*** trunk.orig/gcc/testsuite/gcc.dg/tree-ssa/pta-escape-3.c	2010-10-18 17:44:05.000000000 +0200
--- trunk/gcc/testsuite/gcc.dg/tree-ssa/pta-escape-3.c	2012-08-01 15:48:28.849567831 +0200
*************** int main()
*** 38,42 ****
    return 0;
  }
  
! /* { dg-final { scan-tree-dump "ESCAPED, points-to non-local, points-to NULL, points-to vars: { x }" "alias" } } */
  /* { dg-final { cleanup-tree-dump "alias" } } */
--- 38,42 ----
    return 0;
  }
  
! /* { dg-final { scan-tree-dump "ESCAPED = { NULL ESCAPED NONLOCAL x }" "alias" } } */
  /* { dg-final { cleanup-tree-dump "alias" } } */
Index: trunk/gcc/testsuite/gcc.dg/tree-ssa/pta-ptrarith-1.c
===================================================================
*** trunk.orig/gcc/testsuite/gcc.dg/tree-ssa/pta-ptrarith-1.c	2012-01-03 14:53:17.000000000 +0100
--- trunk/gcc/testsuite/gcc.dg/tree-ssa/pta-ptrarith-1.c	2012-08-01 15:49:36.690565489 +0200
*************** foo(int i, int j, int k, int off)
*** 22,26 ****
    return *q;
  }
  
! /* { dg-final { scan-tree-dump "q_., points-to vars: { k }" "ealias" } } */
  /* { dg-final { cleanup-tree-dump "ealias" } } */
--- 22,26 ----
    return *q;
  }
  
! /* { dg-final { scan-tree-dump "q_. = { k }" "ealias" } } */
  /* { dg-final { cleanup-tree-dump "ealias" } } */
Index: trunk/gcc/testsuite/gcc.dg/tree-ssa/pta-ptrarith-2.c
===================================================================
*** trunk.orig/gcc/testsuite/gcc.dg/tree-ssa/pta-ptrarith-2.c	2012-01-03 14:53:26.000000000 +0100
--- trunk/gcc/testsuite/gcc.dg/tree-ssa/pta-ptrarith-2.c	2012-08-01 15:49:45.451565185 +0200
*************** foo(int i, int j, int k, int off)
*** 22,26 ****
    return *q;
  }
  
! /* { dg-final { scan-tree-dump "q_., points-to vars: { i }" "ealias" } } */
  /* { dg-final { cleanup-tree-dump "ealias" } } */
--- 22,26 ----
    return *q;
  }
  
! /* { dg-final { scan-tree-dump "q_. = { i }" "ealias" } } */
  /* { dg-final { cleanup-tree-dump "ealias" } } */

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH][2/2] Remove referenced vars
  2012-08-02  8:13 ` Richard Guenther
@ 2012-08-05 23:59   ` H.J. Lu
  0 siblings, 0 replies; 3+ messages in thread
From: H.J. Lu @ 2012-08-05 23:59 UTC (permalink / raw)
  To: Richard Guenther; +Cc: gcc-patches, aldyh

On Thu, Aug 2, 2012 at 1:12 AM, Richard Guenther <rguenther@suse.de> wrote:
> On Wed, 1 Aug 2012, Richard Guenther wrote:
>
>>
>> This is the combined patch, ontop of 2a and 2b this removes all
>> gimple_referenced_vars and add_referenced_vars calls.
>>
>> Bootstrapped on x86_64-unknown-linux-gnu, testing in progress.
>>
>> GCC is a better place w/o referenced vars ;)
>
> Re-bootstrapped and tested on x86_64-unknown-linux-gnu ontop of
> what has been actually committed.  Adjusted a few dump-scans in
> points-to analysis.  This will also result in
>
> FAIL: gcc.dg/pr52558-1.c scan-tree-dump-times lim1 "MEM count_lsm..
> count_lsm_fl
> ag" 1
> FAIL: gcc.dg/pr52558-2.c scan-tree-dump-times lim1 "MEM.*g_2_lsm_flag" 1
> FAIL: gcc.dg/tm/reg-promotion.c scan-tree-dump-times lim1 "MEM count_lsm..
> count
> _lsm_flag" 1
>
> as I could not figure out what to replace the previously senseless
> dump scanning with.  There are no changelog entries for the addition
> of these testcases, so I'm not sure whom to nag.  gcc.dg/pr52558-1.c
> was committed by Aldyh at least.  Aldyh - these tests scan for random
> strings and in no way guarantee that the store remains to be executed
> conditional only.  Maybe you should amend the lim dump in case you
> want to only ensure that the lim transform uses conditional replacement?
>
> Committed to trunk.
>
> Richard.
>
> 2012-08-02  Richard Guenther  <rguenther@suse.de>
>
>         * tree-dfa.c (referenced_var_lookup): Remove.
>         (find_referenced_vars): Remove.
>         (pass_referenced_vars): Likewise.
>         (make_rename_temp): Do not add referenced vars.
>         (dump_referenced_vars): Remove.
>         (debug_referenced_vars): Likewise.
>         (dump_dfa_stats): Do not dump referenced var stats.
>         (find_vars_r): Remove.
>         (find_referenced_vars_in): Likewise.
>         (referenced_var_check_and_insert): Likewise.
>         (add_referenced_var_1): Likewise.
>         (remove_referenced_var): Likewise.
>         * tree-flow.h (referenced_var_lookup): Likewise.
>         (struct gimple_df): Remove referenced_vars member.
>         (typedef referenced_var_iterator): Remove.
>         (FOR_EACH_REFERENCED_VAR): Likewise.
>         (num_referenced_vars): Likewise.
>         (debug_referenced_vars, dump_referenced_vars): Likewise.
>         (add_referenced_var_1, add_referenced_var): Likewise.
>         (remove_referenced_var): Likewise.
>         (find_referenced_vars_in): Likewise.
>         * tree-flow-inline.h (gimple_referenced_vars): Remove.
>         (first_referenced_var): Likewise.
>         (end_referenced_vars_p): Likewise.
>         (next_referenced_var): Likewise.
>         * cfgexpand.c (update_alias_info_with_stack_vars): Remove assert.
>         * gimple-pretty-print.c (pp_points_to_solution): Dump UIDs
>         unconditionally.
>         * tree-into-ssa.c (dump_decl_set): Likewise.
>         (pass_build_ssa): Do not require PROP_referenced_vars.
>         * tree-ssa.c (target_for_debug_bind): Virtual operands are
>         not suitable, but all register type vars are.
>         (init_tree_ssa): Do not allocate referenced vars.
>         (delete_tree_ssa): Do not free referenced vars.
>         * cgraphunit.c (init_lowered_empty_function): Do not set
>         PROP_referenced_vars.
>         (assemble_thunk): Do not add referenced vars.
>         * gimple-fold.c (canonicalize_constructor_val): Likewise.
>         (gimplify_and_update_call_from_tree): Likewise.
>         * gimple-streamer-in.c (input_bb): Likewise.
>         * passes.c (init_optimization_passes): Do not run
>         pass_referenced_vars.
>         (dump_properties): Do not dump PROP_referenced_vars.
>         * tree-inline.c (remap_decl): Do not add referenced vars.
>         (remap_gimple_op_r): Likewise.
>         (copy_tree_body_r): Likewise.
>         (copy_bb): Likewise.
>         (setup_one_parameter): Likewise.
>         (declare_return_variable): Likewise.
>         (copy_decl_for_dup_finish): Likewise.
>         (copy_arguments_for_versioning): Likewise.
>         (tree_function_versioning): Likewise.
>         * tree-pass.h (PROP_referenced_vars): Remove.
>         (pass_referenced_vars): Likewise.
>         * tree-profile.c (gimple_gen_edge_profiler): Do not add referenced vars.
>         (gimple_gen_interval_profiler): Likewise.
>         (gimple_gen_pow2_profiler): Likewise.
>         (gimple_gen_one_value_profiler): Likewise.
>         (gimple_gen_ic_profiler): Likewise.
>         (gimple_gen_average_profiler): Likewise.
>         (gimple_gen_ior_profiler): Likewise.
>         * tree-ssa-live.c (remove_unused_locals): Do not touch referenced vars.
>         * tree-cfg.c (replace_ssa_name): Do not add referenced vars.
>         (move_stmt_op): Likewise.
>         * tree-ssa-operands.c (create_vop_var): Likewise.
>         * gimple-low.c (record_vars_into): Likewise.
>         * gimplify.c (gimple_regimplify_operands): Likewise.
>         (force_gimple_operand_1): Likewise.
>         * omp-low.c (expand_omp_for_generic): Likewise.
>         (expand_omp_for_static_chunk): Likewise.
>         (expand_omp_atomic_pipeline): Likewise.
>         * graphite-clast-to-gimple.c (graphite_create_new_loop): Likewise.
>         (translate_clast_assignment): Likewise.
>         * graphite-sese-to-poly.c (create_zero_dim_array): Likewise.
>         (handle_scalar_deps_crossing_scop_limits): Likewise.
>         * ipa-prop.c (ipa_modify_formal_parameters): Likewise.
>         * ipa-split.c (split_function): Likewise.
>         * matrix-reorg.c (transform_access_sites): Likewise.
>         * trans-mem.c (tm_log_add): Likewise.
>         (ipa_tm_insert_gettmclone_call): Likewise.
>         * tree-complex.c (create_one_component_var): Likewise.
>         * tree-if-conv.c (ifc_temp_var): Likewise.
>         * tree-parloops.c (take_address_of): Likewise.
>         (initialize_reductions): Likewise.
>         (separate_decls_in_region_name): Likewise.
>         (create_call_for_reduction_1): Likewise.
>         (separate_decls_in_region): Likewise.
>         * tree-predcom.c (predcom_tmp_var): Likewise.
>         (reassociate_to_the_same_stmt): Likewise.
>         * tree-sra.c (build_ref_for_offset): Likewise.
>         (create_access_replacement): Likewise.
>         (get_replaced_param_substitute): Likewise.
>         (sra_ipa_reset_debug_stmts): Likewise.
>         * tree-ssa-loop-im.c (rewrite_reciprocal): Likewise.
>         (rewrite_bittest): Likewise.
>         * tree-ssa-loop-ivopts.c (create_new_iv): Likewise.
>         * tree-ssa-loop-manip.c (create_iv): Likewise.
>         (tree_transform_and_unroll_loop): Likewise.
>         * tree-ssa-math-opts.c (powi_as_mults): Likewise.
>         (build_and_insert_call): Likewise.
>         (gimple_expand_builtin_cabs): Likewise.
>         (execute_optimize_bswap): Likewise.
>         * tree-ssa-phiopt.c (conditional_replacement): Likewise.
>         (abs_replacement): Likewise.
>         (cond_store_replacement): Likewise.
>         (cond_if_else_store_replacement_1): Likewise.
>         * tree-ssa-phiprop.c (phiprop_insert_phi): Likewise.
>         * tree-ssa-pre.c (get_representative_for): Likewise.
>         (create_expression_by_pieces): Likewise.
>         (insert_into_preds_of_block): Likewise.
>         * tree-ssa-propagate.c (update_call_from_tree): Likewise.
>         * tree-ssa-reassoc.c (undistribute_ops_list): Likewise.
>         (eliminate_redundant_comparison): Likewise.
>         (rewrite_expr_tree_parallel): Likewise.
>         (get_reassoc_pow_ssa_name): Likewise.
>         * tree-ssa-strlen.c (get_string_length): Likewise.
>         * 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-data-refs.c (vect_get_new_vect_var): Likewise.
>         (vect_create_addr_base_for_vector_ref): Likewise.
>         (vect_permute_store_chain): Likewise.
>         (vect_permute_load_chain): Likewise.
>         * tree-vect-generic.c (expand_vector_divmod): Likewise.
>         * tree-vect-loop-manip.c (set_prologue_iterations): Likewise.
>         (vect_build_loop_niters): Likewise.
>         (vect_generate_tmps_on_preheader): Likewise.
>         (vect_update_ivs_after_vectorizer): Likewise.
>         (vect_gen_niters_for_prolog_loop): Likewise.
>         (vect_do_peeling_for_alignment): Likewise.
>         (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.
>

This caused:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54184

-- 
H.J.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-08-05 23:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-01 13:38 [PATCH][2/2] Remove referenced vars Richard Guenther
2012-08-02  8:13 ` Richard Guenther
2012-08-05 23:59   ` H.J. Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).