PATCH: PR testsuite/39451: Invalid x86 constraint in gcc.dg/asm-b.c

H.J. Lu hjl.tools@gmail.com
Fri Mar 13 04:20:00 GMT 2009


On Thu, Mar 12, 2009 at 09:01:15PM -0700, H.J. Lu wrote:
> The "r" constraint means any integer registers. But %b1/%h1 requires
> the "Q" constraint.  OK for trunk and 4.3?
> 

"movb %h1,(%2)" also requires the "R" constraint since you can't
encode "mov %Xh, (%rXX)". OK for trunk and 4.3?

Thanks.


H.J.
---
2009-03-12  H.J. Lu  <hongjiu.lu@intel.com>

	PR testsuite/39451
	* gcc.dg/asm-b.c: Use "Q" constraint on %b1/%h1 and "R"
	constraint on (%2).

Index: gcc/testsuite/gcc.dg/asm-b.c
===================================================================
--- gcc/testsuite/gcc.dg/asm-b.c	(revision 144812)
+++ gcc/testsuite/gcc.dg/asm-b.c	(working copy)
@@ -24,8 +24,7 @@ bar (void)
 #if defined (__powerpc__) || defined (__PPC__) || defined (__ppc__) || defined (_POWER) || defined (__ppc64__)
   __asm __volatile ("sthbrx %1,0,%2" : "=m" (*z) : "r" (y), "r" (z));
 #elif defined __i386__ || defined __x86_64__
-  __asm __volatile ("movb %b1,1(%2); movb %h1,(%2)" : "=m" (*z) : "r" (y), "r"
-(z));
+  __asm __volatile ("movb %b1,1(%2); movb %h1,(%2)" : "=m" (*z) : "Q" (y), "R" (z));
 #endif
   return (x & 1) == 0;
 }



More information about the Gcc-patches mailing list