[EMAIL PROTECTED] wrote:

  Review of x86 asm, fixing intel_atomic_add32 with gcc 2.7.2.1 which
  doesn't allow the '+' constraint on an output operand.

oops, thanks for catching that. I should have read the older gcc doc.

       asm volatile ("lock; xaddl %0,%1"
  -                  : "+r"(val), "+m"(*mem) /* outputs and inputs */
  -                  :
  -                  : "memory");            /*XXX is this needed?  it knows 
that
  -                                                *mem is an output */
  +                  : "=r"(val), "=m"(*mem) /* outputs */
  +                  : "0"(val), "m"(*mem)   /* inputs */
  +                  : "memory", "cc");

so listing *mem as an output isn't sufficient to tell gcc that this specific memory variable is updated?


Greg



Reply via email to