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 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.


r~


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