/* Callgraph based analysis of static variables.
- Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005, 2007, 2008, 2009, 2010
+ Free Software Foundation, Inc.
Contributed by Kenneth Zadeck <zadeck@naturalbridge.com>
This file is part of GCC.
{
/* If the variable has the "used" attribute, treat it as if it had a
been touched by the devil. */
- if (lookup_attribute ("used", DECL_ATTRIBUTES (t)))
+ if (DECL_PRESERVE_P (t))
return false;
/* Do not want to do anything with volatile except mark any
mark_address (gimple stmt ATTRIBUTE_UNUSED, tree addr,
void *data ATTRIBUTE_UNUSED)
{
- while (handled_component_p (addr))
- addr = TREE_OPERAND (addr, 0);
- mark_address_taken (addr);
+ addr = get_base_address (addr);
+ if (addr)
+ mark_address_taken (addr);
return false;
}
mark_load (gimple stmt ATTRIBUTE_UNUSED, tree t, void *data)
{
ipa_reference_local_vars_info_t local = (ipa_reference_local_vars_info_t)data;
- if (TREE_CODE (t) == VAR_DECL
+ t = get_base_address (t);
+ if (t && TREE_CODE (t) == VAR_DECL
&& has_proper_scope_for_analysis (t))
bitmap_set_bit (local->statics_read, DECL_UID (t));
return false;
mark_store (gimple stmt ATTRIBUTE_UNUSED, tree t, void *data)
{
ipa_reference_local_vars_info_t local = (ipa_reference_local_vars_info_t)data;
- if (TREE_CODE (t) == VAR_DECL
+ t = get_base_address (t);
+ if (t && TREE_CODE (t) == VAR_DECL
&& has_proper_scope_for_analysis (t))
{
if (local)
generate_summary, /* generate_summary */
ipa_reference_write_summary, /* write_summary */
ipa_reference_read_summary, /* read_summary */
- NULL, /* function_read_summary */
+ NULL, /* write_optimization_summary */
+ NULL, /* read_optimization_summary */
NULL, /* stmt_fixup */
0, /* TODOs */
NULL, /* function_transform */