Commit a502e677 by Richard Guenther Committed by Richard Biener

tree-dfa.c (find_vars_r): Do not call add_referenced_vars for globals.

2012-05-29  Richard Guenther  <rguenther@suse.de>

	* tree-dfa.c (find_vars_r): Do not call add_referenced_vars
	for globals.
	(add_referenced_var_1): Re-organize.  Assert we are not
	called for globals.
	(remove_referenced_var): Likewise.
	* varpool.c (add_new_static_var): Use create_tmp_var_raw.
	* tree-mudflap.c (execute_mudflap_function_ops): Do not
	call add_referenced_var on globals.
	* matrix-reorg.c (transform_access_sites): Likewise.

From-SVN: r187955
parent 9ff3c7ca
2012-05-29 Richard Guenther <rguenther@suse.de>
* tree-dfa.c (find_vars_r): Do not call add_referenced_vars
for globals.
(add_referenced_var_1): Re-organize. Assert we are not
called for globals.
(remove_referenced_var): Likewise.
* varpool.c (add_new_static_var): Use create_tmp_var_raw.
* tree-mudflap.c (execute_mudflap_function_ops): Do not
call add_referenced_var on globals.
* matrix-reorg.c (transform_access_sites): Likewise.
2012-05-29 Steven Bosscher <steven@gcc.gnu.org> 2012-05-29 Steven Bosscher <steven@gcc.gnu.org>
* alias.c (reg_known_value): Make this a VEC. * alias.c (reg_known_value): Make this a VEC.
......
...@@ -1914,7 +1914,6 @@ transform_access_sites (void **slot, void *data ATTRIBUTE_UNUSED) ...@@ -1914,7 +1914,6 @@ transform_access_sites (void **slot, void *data ATTRIBUTE_UNUSED)
num_elements = num_elements =
fold_build2 (MULT_EXPR, sizetype, fold_convert (sizetype, acc_info->index), fold_build2 (MULT_EXPR, sizetype, fold_convert (sizetype, acc_info->index),
fold_convert (sizetype, d_size)); fold_convert (sizetype, d_size));
add_referenced_var (d_size);
gsi = gsi_for_stmt (acc_info->stmt); gsi = gsi_for_stmt (acc_info->stmt);
tmp1 = force_gimple_operand_gsi (&gsi, num_elements, true, tmp1 = force_gimple_operand_gsi (&gsi, num_elements, true,
NULL, true, GSI_SAME_STMT); NULL, true, GSI_SAME_STMT);
......
...@@ -430,7 +430,10 @@ find_vars_r (tree *tp, int *walk_subtrees, void *data) ...@@ -430,7 +430,10 @@ find_vars_r (tree *tp, int *walk_subtrees, void *data)
/* If T is a regular variable that the optimizers are interested /* If T is a regular variable that the optimizers are interested
in, add it to the list of variables. */ in, add it to the list of variables. */
else if (SSA_VAR_P (*tp)) 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); add_referenced_var_1 (*tp, fn);
/* Type, _DECL and constant nodes have no interesting children. /* Type, _DECL and constant nodes have no interesting children.
...@@ -560,22 +563,24 @@ add_referenced_var_1 (tree var, struct function *fn) ...@@ -560,22 +563,24 @@ add_referenced_var_1 (tree var, struct function *fn)
|| TREE_CODE (var) == PARM_DECL || TREE_CODE (var) == PARM_DECL
|| TREE_CODE (var) == RESULT_DECL); || TREE_CODE (var) == RESULT_DECL);
if (!(TREE_CODE (var) == VAR_DECL gcc_checking_assert ((TREE_CODE (var) == VAR_DECL
&& VAR_DECL_IS_VIRTUAL_OPERAND (var)) && VAR_DECL_IS_VIRTUAL_OPERAND (var))
&& is_global_var (var)) || !is_global_var (var));
return false;
if (!*DECL_VAR_ANN_PTR (var)) /* Insert VAR into the referenced_vars hash table if it isn't present
*DECL_VAR_ANN_PTR (var) = ggc_alloc_cleared_var_ann_d (); and allocate its var-annotation. */
/* Insert VAR into the referenced_vars hash table if it isn't present. */
if (referenced_var_check_and_insert (var, fn)) if (referenced_var_check_and_insert (var, fn))
return true; {
gcc_checking_assert (!*DECL_VAR_ANN_PTR (var));
*DECL_VAR_ANN_PTR (var) = ggc_alloc_cleared_var_ann_d ();
return true;
}
return false; return false;
} }
/* Remove VAR from the list. */ /* Remove VAR from the list of referenced variables and clear its
var-annotation. */
void void
remove_referenced_var (tree var) remove_referenced_var (tree var)
...@@ -585,14 +590,16 @@ remove_referenced_var (tree var) ...@@ -585,14 +590,16 @@ remove_referenced_var (tree var)
void **loc; void **loc;
unsigned int uid = DECL_UID (var); unsigned int uid = DECL_UID (var);
/* Preserve var_anns of globals. */ gcc_checking_assert (TREE_CODE (var) == VAR_DECL
if (!is_global_var (var) || TREE_CODE (var) == PARM_DECL
&& (v_ann = var_ann (var))) || TREE_CODE (var) == RESULT_DECL);
{
ggc_free (v_ann); gcc_checking_assert (!is_global_var (var));
*DECL_VAR_ANN_PTR (var) = NULL;
} v_ann = var_ann (var);
gcc_assert (DECL_P (var)); ggc_free (v_ann);
*DECL_VAR_ANN_PTR (var) = NULL;
in.uid = uid; in.uid = uid;
loc = htab_find_slot_with_hash (gimple_referenced_vars (cfun), &in, uid, loc = htab_find_slot_with_hash (gimple_referenced_vars (cfun), &in, uid,
NO_INSERT); NO_INSERT);
......
...@@ -427,10 +427,6 @@ execute_mudflap_function_ops (void) ...@@ -427,10 +427,6 @@ execute_mudflap_function_ops (void)
push_gimplify_context (&gctx); push_gimplify_context (&gctx);
add_referenced_var (mf_cache_array_decl);
add_referenced_var (mf_cache_shift_decl);
add_referenced_var (mf_cache_mask_decl);
/* In multithreaded mode, don't cache the lookup cache parameters. */ /* In multithreaded mode, don't cache the lookup cache parameters. */
if (! flag_mudflap_threads) if (! flag_mudflap_threads)
mf_decl_cache_locals (); mf_decl_cache_locals ();
......
...@@ -449,7 +449,7 @@ add_new_static_var (tree type) ...@@ -449,7 +449,7 @@ add_new_static_var (tree type)
tree new_decl; tree new_decl;
struct varpool_node *new_node; struct varpool_node *new_node;
new_decl = create_tmp_var (type, NULL); new_decl = create_tmp_var_raw (type, NULL);
DECL_NAME (new_decl) = create_tmp_var_name (NULL); DECL_NAME (new_decl) = create_tmp_var_name (NULL);
TREE_READONLY (new_decl) = 0; TREE_READONLY (new_decl) = 0;
TREE_STATIC (new_decl) = 1; TREE_STATIC (new_decl) = 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment