diff options
Diffstat (limited to 'gcc/ipa-reference.c')
-rw-r--r-- | gcc/ipa-reference.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/gcc/ipa-reference.c b/gcc/ipa-reference.c index cc790fd..9eac3b1 100644 --- a/gcc/ipa-reference.c +++ b/gcc/ipa-reference.c @@ -352,9 +352,9 @@ static bool 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; } @@ -364,7 +364,8 @@ static bool 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; @@ -376,7 +377,8 @@ static bool 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) |