This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


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

Re: Can't build gcc-3.0.1 for m68k-coff


Hi,
there is another but still unmentioned (although all the preaching was done...) problem
with gcc-3.0.x and m68k, which comes from libstdc++, there is now CPU-specific (m68020
and upwards) code in 'libstdc++-v3/config/cpu/m68k/bits/atomicity.h' :

------------------------------- clip ---------------------------
// Low-level functions for atomic operations: m680x0, x >= 2 version -*- C++ -*-

<snip>

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;
}
------------------------------- clip ---------------------------

 This causes the assembly code:

------------------------------- clip ---------------------------
#APP
	1: move.l %d0,%d2;   add.l %d1,%d2;   cas.l %d0,%d2,(%a0);   jbne 1b
#NO_APP
------------------------------- clip ---------------------------

generated also for CPUs like 'm68000' and 'mcpu32'...

 Has anyone any clue about what this is trying to do and how to
implement the same thing with 68000, CPU32, Coldfire etc. which
don't understand the 'cas.l' ?

Cheers, Kai


------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com


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