Commit 7946578b by Richard Guenther Committed by Richard Biener

tree-flow-inline.h (is_global_var): Do not check TREE_STATIC on MTAGs.

2008-06-04  Richard Guenther  <rguenther@suse.de>

	* tree-flow-inline.h (is_global_var): Do not check TREE_STATIC
	on MTAGs.
	(is_call_clobbered): Always check var_ann->call_clobbered.
	(mark_call_clobbered): Always set var_ann->call_clobbered.
	(clear_call_clobbered): Always clear var_ann->call_clobbered.
	* tree-ssa-alias.c (mark_non_addressable): Use clear_call_clobbered.
	(reset_alias_info): Clear call clobbering info on MTAGs and
	globals as well.
	(set_pt_anything): Set pt_global_mem.
	(create_tag_raw): Adjust comment.
	(may_be_aliased): Do not check TREE_PUBLIC on MTAGs.

From-SVN: r136360
parent b67758fe
2008-06-04 Richard Guenther <rguenther@suse.de>
* tree-flow-inline.h (is_global_var): Do not check TREE_STATIC
on MTAGs.
(is_call_clobbered): Always check var_ann->call_clobbered.
(mark_call_clobbered): Always set var_ann->call_clobbered.
(clear_call_clobbered): Always clear var_ann->call_clobbered.
* tree-ssa-alias.c (mark_non_addressable): Use clear_call_clobbered.
(reset_alias_info): Clear call clobbering info on MTAGs and
globals as well.
(set_pt_anything): Set pt_global_mem.
(create_tag_raw): Adjust comment.
(may_be_aliased): Do not check TREE_PUBLIC on MTAGs.
2008-06-04 Joseph Myers <joseph@codesourcery.com> 2008-06-04 Joseph Myers <joseph@codesourcery.com>
Maxim Kuvyrkov <maxim@codesourcery.com> Maxim Kuvyrkov <maxim@codesourcery.com>
......
...@@ -698,7 +698,7 @@ static inline bool ...@@ -698,7 +698,7 @@ static inline bool
is_global_var (const_tree t) is_global_var (const_tree t)
{ {
if (MTAG_P (t)) if (MTAG_P (t))
return (TREE_STATIC (t) || MTAG_GLOBAL (t)); return MTAG_GLOBAL (t);
else else
return (TREE_STATIC (t) || DECL_EXTERNAL (t)); return (TREE_STATIC (t) || DECL_EXTERNAL (t));
} }
...@@ -875,10 +875,7 @@ factoring_name_p (const_tree name) ...@@ -875,10 +875,7 @@ factoring_name_p (const_tree name)
static inline bool static inline bool
is_call_clobbered (const_tree var) is_call_clobbered (const_tree var)
{ {
if (!MTAG_P (var)) return var_ann (var)->call_clobbered;
return var_ann (var)->call_clobbered;
else
return bitmap_bit_p (gimple_call_clobbered_vars (cfun), DECL_UID (var));
} }
/* Mark variable VAR as being clobbered by function calls. */ /* Mark variable VAR as being clobbered by function calls. */
...@@ -886,8 +883,7 @@ static inline void ...@@ -886,8 +883,7 @@ static inline void
mark_call_clobbered (tree var, unsigned int escape_type) mark_call_clobbered (tree var, unsigned int escape_type)
{ {
var_ann (var)->escape_mask |= escape_type; var_ann (var)->escape_mask |= escape_type;
if (!MTAG_P (var)) var_ann (var)->call_clobbered = true;
var_ann (var)->call_clobbered = true;
bitmap_set_bit (gimple_call_clobbered_vars (cfun), DECL_UID (var)); bitmap_set_bit (gimple_call_clobbered_vars (cfun), DECL_UID (var));
} }
...@@ -899,8 +895,7 @@ clear_call_clobbered (tree var) ...@@ -899,8 +895,7 @@ clear_call_clobbered (tree var)
ann->escape_mask = 0; ann->escape_mask = 0;
if (MTAG_P (var)) if (MTAG_P (var))
MTAG_GLOBAL (var) = 0; MTAG_GLOBAL (var) = 0;
if (!MTAG_P (var)) var_ann (var)->call_clobbered = false;
var_ann (var)->call_clobbered = false;
bitmap_clear_bit (gimple_call_clobbered_vars (cfun), DECL_UID (var)); bitmap_clear_bit (gimple_call_clobbered_vars (cfun), DECL_UID (var));
} }
......
...@@ -305,10 +305,7 @@ mark_non_addressable (tree var) ...@@ -305,10 +305,7 @@ mark_non_addressable (tree var)
mpt = memory_partition (var); mpt = memory_partition (var);
if (!MTAG_P (var)) clear_call_clobbered (var);
var_ann (var)->call_clobbered = false;
bitmap_clear_bit (gimple_call_clobbered_vars (cfun), DECL_UID (var));
TREE_ADDRESSABLE (var) = 0; TREE_ADDRESSABLE (var) = 0;
if (mpt) if (mpt)
...@@ -2003,22 +2000,13 @@ reset_alias_info (void) ...@@ -2003,22 +2000,13 @@ reset_alias_info (void)
bitmap_set_bit (all_nmts, DECL_UID (var)); bitmap_set_bit (all_nmts, DECL_UID (var));
/* Since we are about to re-discover call-clobbered /* Since we are about to re-discover call-clobbered
variables, clear the call-clobbered flag. Variables that variables, clear the call-clobbered flag. */
are intrinsically call-clobbered (globals, local statics, clear_call_clobbered (var);
etc) will not be marked by the aliasing code, so we can't
remove them from CALL_CLOBBERED_VARS.
NB: STRUCT_FIELDS are still call clobbered if they are for a
global variable, so we *don't* clear their call clobberedness
just because they are tags, though we will clear it if they
aren't for global variables. */
if (TREE_CODE (var) == NAME_MEMORY_TAG
|| TREE_CODE (var) == SYMBOL_MEMORY_TAG
|| TREE_CODE (var) == MEMORY_PARTITION_TAG
|| !is_global_var (var))
clear_call_clobbered (var);
} }
/* There should be no call-clobbered variable left. */
gcc_assert (bitmap_empty_p (gimple_call_clobbered_vars (cfun)));
/* Clear flow-sensitive points-to information from each SSA name. */ /* Clear flow-sensitive points-to information from each SSA name. */
for (i = 1; i < num_ssa_names; i++) for (i = 1; i < num_ssa_names; i++)
{ {
...@@ -2830,6 +2818,8 @@ set_pt_anything (tree ptr) ...@@ -2830,6 +2818,8 @@ set_pt_anything (tree ptr)
struct ptr_info_def *pi = get_ptr_info (ptr); struct ptr_info_def *pi = get_ptr_info (ptr);
pi->pt_anything = 1; pi->pt_anything = 1;
/* Anything includes global memory. */
pi->pt_global_mem = 1;
pi->pt_vars = NULL; pi->pt_vars = NULL;
/* The pointer used to have a name tag, but we now found it pointing /* The pointer used to have a name tag, but we now found it pointing
...@@ -2926,12 +2916,12 @@ create_tag_raw (enum tree_code code, tree type, const char *prefix) ...@@ -2926,12 +2916,12 @@ create_tag_raw (enum tree_code code, tree type, const char *prefix)
tmp_var = build_decl (code, create_tmp_var_name (prefix), type); tmp_var = build_decl (code, create_tmp_var_name (prefix), type);
/* Make the variable writable. */ /* Memory tags are always writable and non-static. */
TREE_READONLY (tmp_var) = 0; TREE_READONLY (tmp_var) = 0;
TREE_STATIC (tmp_var) = 0;
/* It doesn't start out global. */ /* It doesn't start out global. */
MTAG_GLOBAL (tmp_var) = 0; MTAG_GLOBAL (tmp_var) = 0;
TREE_STATIC (tmp_var) = 0;
TREE_USED (tmp_var) = 1; TREE_USED (tmp_var) = 1;
return tmp_var; return tmp_var;
...@@ -3365,7 +3355,7 @@ may_be_aliased (tree var) ...@@ -3365,7 +3355,7 @@ may_be_aliased (tree var)
/* Globally visible variables can have their addresses taken by other /* Globally visible variables can have their addresses taken by other
translation units. */ translation units. */
if (MTAG_P (var) if (MTAG_P (var)
&& (MTAG_GLOBAL (var) || TREE_PUBLIC (var))) && MTAG_GLOBAL (var))
return true; return true;
else if (!MTAG_P (var) else if (!MTAG_P (var)
&& (DECL_EXTERNAL (var) || TREE_PUBLIC (var))) && (DECL_EXTERNAL (var) || TREE_PUBLIC (var)))
......
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