+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>
Maxim Kuvyrkov <maxim@codesourcery.com>
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));
}
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. */
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));
}
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));
}
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)
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++)
{
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
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;
/* 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)))