On Thu, Nov 16, 2017 at 05:15:20PM -0700, Jeff Law wrote: > > + tree_code code = gimple_assign_rhs_code (def); > > + if (code == ADDR_EXPR > > + || code == COMPONENT_REF > > + || code == VAR_DECL) > > + dcl = gimple_assign_rhs1 (def); > Note that COMPONENT_REFs can have arguments that are themselves > COMPONENT_REFS. So you typically want to use a loop to strip all away.
Do you want to handle just COMPONENT_REF, or other handled components (ARRAY_REFs, etc.)? We have handled_component_p predicate and get_base_address to strip them (or get_inner_reference if you want other details about it). Jakub