[Bug target/42553] wrong code with -O1
pinskia at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Wed Dec 30 14:33:00 GMT 2009
------- Comment #2 from pinskia at gcc dot gnu dot org 2009-12-30 14:33 -------
The inline-asm is totally incorrect here is the corrected version of the
function (note res should be set):
static bool atomic_test_and_reset_bit(unsigned long *v,unsigned long bit) {
bool res = 0;
__asm__ __volatile__( "btr %2,%1\n"
"adc $0,%0\n"
:"+r"(res): "m"(*v)
,"r"(bit), "r"(0): "flags") ;
return res ? 1 : 0;
}
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42553
More information about the Gcc-bugs
mailing list