[Bug inline-asm/8375] Constraints on inline assembly
pinskia at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Sat Aug 9 01:14:00 GMT 2003
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=8375
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |INVALID
------- Additional Comments From pinskia at gcc dot gnu dot org 2003-08-09 01:14 -------
The code is invalid you should use + instead of = and 0:
static inline int atomic_inc(volatile int *p)
{
__asm__ __volatile__(
"lock; incl %0"
:"+m" (*p));
return (*p);
}
More information about the Gcc-bugs
mailing list