optimization/5366: asm code produces an error without -O but is ok with -O

Richard Henderson rth@redhat.com
Mon Jan 14 18:26:00 GMT 2002


The following reply was made to PR optimization/5366; it has been noted by GNATS.

From: Richard Henderson <rth@redhat.com>
To: erl-dev@altus.qc.ca
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: optimization/5366: asm code produces an error without -O but is ok with -O
Date: Mon, 14 Jan 2002 18:18:39 -0800

 On Sat, Jan 12, 2002 at 07:29:09PM -0500, erl-dev@altus.qc.ca wrote:
 > 	   __asm __volatile ("" : "=m" (lock->__status) : "0" (lock->__status));
 
 You needn't bother with the matching constraint, and that is
 in fact what leads to your troubles.
 
 The memory address is fully specified by lock->__status.  Since
 the same value is used on both sides, you know it is the same
 address, and thus using "=m" and "m" is sufficient.
 
 At -O0, the address calculations for the two structure references
 are not subject to common subexpression elimination, so the 
 register allocator cannot easily prove that the two addresses
 are the same, so it aborts.
 
 
 r~



More information about the Gcc-prs mailing list