On Wed, 20 Jul 2011, Ulrich Weigand wrote: > Richard Guenther wrote: > > On Tue, Jul 19, 2011 at 8:20 PM, Ulrich Weigand <uweig...@de.ibm.com> wrote: > > > The problem is that in this expression > > > disappear = VIEW_CONVERT_EXPR<struct VecClass>(x_8); > > > the rhs is considered unaligned and blocks the SRA transformation. > > > > > > The check you added for SSA_NAMEs doesn't hit, because the SSA_NAME is > > > encapsulated in a VIEW_CONVERT_EXPR. When get_object_alignment is called, > > > the VIEW_CONVERT_EXPR is stripped off by get_inner_reference and the > > > SSA_NAME appears, but then get_object_alignment doesn't handle it > > > and just returns the default alignment of 8 bits. > > > > > > Maybe get_object_alignment should itself handle SSA_NAMEs? > > > > But what should it return for a rvalue? There is no "alignment" here. > > I think SRA should avoid asking for rvalues. > > I must admit I do not fully understand what the SRA code is attempting > to achieve here ... Could you elaborate on what you mean by "avoid > asking for rvalues"? Should the SRA code never check the RHS of an > assignment for alignment, only the LHS? Or should it classify the RHS > tree according to whether the access is rvalue or lvalue (how would > that work?)?
Well, it should only ask for stores / loads. I'm not sure what we'd want to return as alignment for an rvalue - MAX_ALIGNMENT? What should we return for get_object_alignment of an INTEGER_CST for example? Richard.