From: Richard Guenther Date: Wed, 4 Jun 2008 16:00:10 +0000 (+0000) Subject: tree-flow-inline.h (is_global_var): Do not check TREE_STATIC on MTAGs. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7946578b7e20d8f07169c5989915e098d591ffa6;p=gcc.git tree-flow-inline.h (is_global_var): Do not check TREE_STATIC on MTAGs. 2008-06-04 Richard Guenther * 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e7e91d7bb15..ed7c58c5c82 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,17 @@ +2008-06-04 Richard Guenther + + * 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 Maxim Kuvyrkov diff --git a/gcc/tree-flow-inline.h b/gcc/tree-flow-inline.h index 95ddfb5b130..a8dc8fffa73 100644 --- a/gcc/tree-flow-inline.h +++ b/gcc/tree-flow-inline.h @@ -698,7 +698,7 @@ static inline bool is_global_var (const_tree t) { if (MTAG_P (t)) - return (TREE_STATIC (t) || MTAG_GLOBAL (t)); + return MTAG_GLOBAL (t); else return (TREE_STATIC (t) || DECL_EXTERNAL (t)); } @@ -875,10 +875,7 @@ factoring_name_p (const_tree name) static inline bool is_call_clobbered (const_tree var) { - if (!MTAG_P (var)) - return var_ann (var)->call_clobbered; - else - return bitmap_bit_p (gimple_call_clobbered_vars (cfun), DECL_UID (var)); + return var_ann (var)->call_clobbered; } /* Mark variable VAR as being clobbered by function calls. */ @@ -886,8 +883,7 @@ static inline void mark_call_clobbered (tree var, unsigned int 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)); } @@ -899,8 +895,7 @@ clear_call_clobbered (tree var) ann->escape_mask = 0; if (MTAG_P (var)) 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)); } diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c index 1523aebac17..05c123c0e99 100644 --- a/gcc/tree-ssa-alias.c +++ b/gcc/tree-ssa-alias.c @@ -305,10 +305,7 @@ mark_non_addressable (tree var) mpt = memory_partition (var); - if (!MTAG_P (var)) - var_ann (var)->call_clobbered = false; - - bitmap_clear_bit (gimple_call_clobbered_vars (cfun), DECL_UID (var)); + clear_call_clobbered (var); TREE_ADDRESSABLE (var) = 0; if (mpt) @@ -2003,22 +2000,13 @@ reset_alias_info (void) bitmap_set_bit (all_nmts, DECL_UID (var)); /* Since we are about to re-discover call-clobbered - variables, clear the call-clobbered flag. Variables that - are intrinsically call-clobbered (globals, local statics, - 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); + variables, clear the call-clobbered flag. */ + 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. */ for (i = 1; i < num_ssa_names; i++) { @@ -2830,6 +2818,8 @@ set_pt_anything (tree ptr) struct ptr_info_def *pi = get_ptr_info (ptr); pi->pt_anything = 1; + /* Anything includes global memory. */ + pi->pt_global_mem = 1; pi->pt_vars = NULL; /* 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) 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_STATIC (tmp_var) = 0; /* It doesn't start out global. */ MTAG_GLOBAL (tmp_var) = 0; - TREE_STATIC (tmp_var) = 0; TREE_USED (tmp_var) = 1; return tmp_var; @@ -3365,7 +3355,7 @@ may_be_aliased (tree var) /* Globally visible variables can have their addresses taken by other translation units. */ if (MTAG_P (var) - && (MTAG_GLOBAL (var) || TREE_PUBLIC (var))) + && MTAG_GLOBAL (var)) return true; else if (!MTAG_P (var) && (DECL_EXTERNAL (var) || TREE_PUBLIC (var)))