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: libjava failed to build on Linux/x86


This happened once before.  IIRC, the conclusion then was that it might be
better to change "=m" to "+m" and to remove the "0"(*(addr)) argument.  But
as it stands, this very closely follows one of the examples in the gcc
manual, so it seems to primarily be a gcc bug.

Hans

> -----Original Message-----
> From: Per Bothner [mailto:per@bothner.com]
> In 
> function `bool
>     compare_and_swap(volatile obj_addr_t*, unsigned int, 
> unsigned int)':
> /home/bothner/GNU/gcc/libjava/java/lang/natObject.cc:329: 
> inconsistent 
> operand
>     constraints in an `asm'
> make[3]: *** [java/lang/natObject.lo] Error 1
> 
> The asm is:
> 
>    inline static bool
>    compare_and_swap(volatile obj_addr_t *addr,
> 		 
> 				obj_addr_t old,
> 						obj_addr_t new_val)
>    {
>      char result;
>      __asm__ __volatile__("lock; cmpxchgl %2, %0; setz %1"
> 	    	: "=m"(*(addr)), "=q"(result)
> 		: "r" (new_val), "0"(*(addr)), "a"(old) : "memory");
>      return (bool) result;
>    }
> 
> 
> -- 
> 	--Per Bothner
> per@bothner.com   http://www.bothner.com/per/
> 


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