> Hmm. I think this points to an issue with update_alias_info_with_stack_vars > instead. That is, this function should have already cared for handling > this case where two decls have their stack slot shared.
The problem here is that mark_addressable is called _after_ the function is run. IOW, by the time update_alias_info_with_stack_vars is run, there are no aliased variables in the function. > static bool > can_escape (tree expr) > { > tree base; > if (!expr) > return true; > base = get_base_address (expr); > if (DECL_P (base) > && !may_be_aliased (base)) > return false; > return true; > > it needs to check decls_to_pointers[base] and then check > if any of the pointed-to decls may be aliased. That's essentially what the patch does though (except that it does it more efficiently), since update_alias_info_with_stack_vars correctly computes cfun->gimple_df->escaped.vars for partitioned decls. > Now, that's not that easy because we don't have a > mapping from DECL UID to DECL (and the decl > isn't in the escaped solution if it is just used by > memcpy), but we could compute a bitmap of > all address-taken decls in update_alias_info_with_stack_vars > or simply treat all check decls_to_pointers[base] != NULL > bases as possibly having their address taken. OK, we can populate another bitmap in update_alias_info_with_stack_vars and update it in mark_addressable by means of decls_to_pointers and pi->pt.vars. That seems a bit redundant with cfun->gimple_df->escaped.vars, but why not. -- Eric Botcazou