This is the mail archive of the gcc@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: ARM gcc generates incorrect code?


On 27 February 2008 13:07, Krzysztof Halasa wrote:

> "Dave Korn" writes:
> 
>>> #define get_user(x,p)
\
>>> 	({								\
>>> 		register const u8 __user *__p asm("r0") = (p);		\
>>> 		register unsigned long __r2 asm("r2");			\
>>> 		register int __e asm("r0");				\
>>> 		__asm__ __volatile__ (					\
>>> 			__asmeq("%0", "r0") __asmeq("%1", "r2")		\
>>> 			"bl	__get_user_1"				\
>>> 			: "=&r" (__e), "=r" (__r2)			\
>>                     ^^^^^ '&' means output operand (zero)
>>                           is early-clobber, so cannot share
>>                           a register with any input operand.
> 
> Well, GCC-Inline-Assembly-HOWTO.html says "An input operand can be
> tied to an earlyclobber operand if its only use as an input occurs
> before the early result is written" and it seems it's the case.

  Hmmm, true, so I guess that shouldn't be a problem, unless a bug has cropped
up in that area of the compiler.


    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....


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