[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[Bug target/42553] wrong code with -O1




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

------- You are receiving this mail because: -------
You reported the bug, or are watching the reporter.


Reply to: