This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

m68k problem and libstdc++


Hi,

I am investigating an m68k problem
and libstdc++:
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&database=gcc&pr=5198

An assembler error is resulting:
Error: invalid instruction for this architecture; needs 68020 or higher -- statement `cas.l %d0,%d1,(%a0)' ignored

I suspect it is because of the code in
libstdc++-v3/config/cpu/m68k/atomicity.h:

static inline _Atomic_word
__attribute__ ((__unused__))
__exchange_and_add (volatile _Atomic_word *__mem, int __val)
{
  register _Atomic_word __result = *__mem;
  register _Atomic_word __temp;
  __asm__ __volatile__ ("1: move%.l %0,%1;"
                        "   add%.l %2,%1;"
                        "   cas%.l %0,%1,%3;"
                        "   jbne 1b"
                        : "=d" (__result), "=&d" (__temp)
                        : "d" (__val), "m" (*__mem), "0" (__result)
                        : "memory");
  return __result;
}

I'm not a 68000 asm expert.  Does anyone have an idea as
to what the fix could be?
-- 
Craig Rodrigues        
http://www.gis.net/~craigr    
rodrigc@mediaone.net          


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]