libjava failed to build on Linux/x86

Boehm, Hans hans_boehm@hp.com
Thu Jan 24 16:34:00 GMT 2002


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



More information about the Java mailing list