This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix PR inline-asm/16194, register and clobbers


On Mon, 2005-01-17 at 20:07 -0800, Richard Henderson wrote:
> On Sat, Jan 15, 2005 at 02:18:35AM -0500, Andrew Pinski wrote:
> > +      /* If we have an indirect reference and we allow memory, skip the
> > +         INDIRECT_REF when looking at if a register conflicts with the clobbers.  */
> > +      if (TREE_CODE (val) == INDIRECT_REF
> > +	   && allows_mem)
> > +        val = TREE_OPERAND (val, 0);
> > +      
> >        if (decl_conflicts_with_clobbers_p (val, clobbered_regs))
> 
> Not even close to complete.  Consider
> 
> 	struct A
> 	{
> 	  int a;
> 	};
> 
> 	struct B
> 	{
> 	  struct A b[3];
> 	};
> 
> 	struct C
> 	{
> 	  struct B c;
> 	};
> 
> 	register struct C *dst __asm (REG);
> 	__asm__ ("" : "=g"(dst->c.b[1].a) : : REG);
> 
> Also note that the test should use "" for the template.
Which makes me wonder if we ought to be doing something like

while (handled_component_p (val) || TREE_CODE (val) == INDIRECT_REF)
  val = TREE_OPERAND (val, 0)

What's not entirely clear to me is whether or not we need to look
at thinks like an array index (if it is non-constant).   For
example, given dst->c.b[i].a, do we need to look at both DST and I
or is just DST sufficient for our needs?

jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]